DelDir (delete a directory)

function DelDir(what: string): boolean;

This function attempts to delete the what directory in the local file-system, and returns true if the deleteion is successful, or false if the function fails.

Warning

This function will fail if the directory you’re trying to delete is not empty. In order to completely and recursively delete a directory and all of its files and subdirectories with a single command, you may want to take a look at the DelTree function.

This function accepts the following parameters:

Parameter Type Requirement Explanation
what string required must be a valid and existing path to an empty directory you wish to delete

Possible return values:

Value Explanation
true the function succeeded: the directory was deleted
false the function failed: the directory was not deleted