FileUtil.CopyFileOrDirectory 复制文件或文件夹

static function CopyFileOrDirectory (from : string, to : string) : void

Description描述

Copies a file or a directory.

复制文件或者文件夹。

This function's path can be relative to the project root folder or be an absolute path.

这个方法可以使用相对路径也可以使用那个绝对路径

All file separators should be forward ones "/".

所有的文件目录分隔符必须使用"/"格式

Make sure to include the name of the files or directories at the end of the "to" argument.

一定要在函数的最后一个参数上添加要把文件拷贝到的目录

@MenuItem ("Example/Copy Something")
static function CopyAFile () {
	// copies the file "YourFileOrFolder" from "path/" to "copy/path/"
	//从"path/"复制文件YourFileOrFolder,到"copy/path/"
	FileUtil.CopyFileOrDirectory ("path/YourFileOrFolder", "copy/path/YourFileOrFolder");
}
Page last updated: 2011-5-7