格式
typescript
File.Copy(src, dst)所属类: File
描述
复制源文件到指定目录。
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| src | string | 源文件路径 |
| dst | string | 目标文件路径 |
返回值
| 类型 | 描述 |
|---|---|
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);
}
}