格式
typescript
File.Move(src, dst)所属类: File
描述
移动源文件到指定路径。
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| src | string | 源文件路径 |
| dst | string | 目标路径 |
返回值
| 类型 | 描述 |
|---|---|
void |
代码示例
javascript
function Test(src_path: string, dst_path: string) {
File.Move(src_path, dst_path);
try {
if (!File.Exists(dst_path)) {
Debug.Error("File '", src_path, "' has been moved to '", dst_path, "', but dest file does not exist.");
}
if (File.Exists(src_path)) {
Debug.Error("File '", src_path, "' has been moved to '", dst_path, "', but src file still exist.");
}
} catch (error) {
Debug.Error(error);
}
}