格式
typescript
File.Delete(path)所属类: File
描述
删除指定路径的文件。
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| path | string | 指定路径 |
返回值
| 类型 | 描述 |
|---|---|
void |
代码示例
javascript
function Test(file_path: string) {
try {
if (File.Exists(file_path)) {
File.Delete(file_path);
if (File.Exists(file_path)) {
Debug.Error("File '", file_path, "' delete failed.");
return;
}
}
} catch (error) {
Debug.Error(error);
}
}