Skip to content

格式

typescript
File.Copy(src, dst)

所属类: File

描述

复制源文件到指定目录。

参数

参数名类型描述
srcstring源文件路径
dststring目标文件路径

返回值

类型描述
void

代码示例

javascript
function Test(src_path: string, dst_path: string) {  
	try {
		File.Copy(src_path, dst_path);
		if (!File.Exists(dst_path)) {
			Debug.Error("File '", src_path, "' has been copyed to '", dst_path, "', but dest file does not exist.");
		}
	} catch (error) {
		Debug.Error(error);
	}
}