DelFile (delete a file)
ts
function DelFile(what: string): boolean;Deletes the file specified by what from the local file system. Returns true if the operation is successful, or false if it fails.
| Parameter | Type | Requirement | Explanation |
|---|---|---|---|
what | string | required | Path to a valid, existing file in the local file system |
| Return value | Explanation |
|---|---|
true | The file was successfully deleted |
false | The operation failed; the file was not deleted |
Example
ts
var result = DelFile('/home/user/data.txt');
if (result) {
Log('File deleted successfully.');
} else {
Log('File deletion failed.');
}