FileUtil.ReplaceDirectory 替换文件夹

static function ReplaceFile (src : string, dst : string) : void


Replaces a directory.


Replaces the directory located at dst with the directory located at src. if dst doesnt exists it copies the file. If dst exists then it deletes it and copies the directory at src to dst

用src指定的文件夹替换Dst 指定的文件夹,如果dst指定的文件夹不存在这个方法会拷贝src指定的文件夹到dst文件夹,如果存在这个方法会下删除dst 指定的文件夹然后从scr指定的文件夹拷贝到dst指定的文件夹。


// creates a menu entry that replaces a directory.

@MenuItem ("Example/Replace Some Directory")
static function ReplaceADirectory () {
	// Replaces the directory at "Folder" with "ReplacedFolder"
	FileUtil.ReplaceDirectory("path/To/Your/Folder", "path/To/Your/ReplacedFolder");
Page last updated: 2011-5-7