Skip to content

DelTree (delete directory-tree)

ts
function DelTree(what: string): boolean;

Attempts to delete the directory specified by what in the local file system, including all files and subdirectories it contains. Returns true if the deletion is successful, or false if it fails.

ParameterTypeRequirementExplanation
whatstringrequiredPath to a valid, existing directory you wish to delete (including all contents)
Return valueExplanation
trueThe directory and all its contents were successfully deleted
falseThe operation failed; the directory was not deleted

Example

ts
var result = DelTree('/home/user/oldproject');
if (result) {
  Log('Directory tree deleted successfully.');
} else {
  Log('Directory tree deletion failed.');
}