Skip to content

format

typescript
File.Delete(path)

class: File

description

Deletes the file at the specified path.

parameter

param_nametypedescription
pathstringThe specified path.

return

typedescription
void

code example

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);
    }
}