Skip to content

DelDir (delete an empty directory)

ts
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:

ParameterTypeRequirementExplanation
whatstringrequiredmust be a valid and existing path to an empty directory you wish to delete

Possible return values:

ValueExplanation
truethe function succeeded: the directory was deleted
falsethe function failed: the directory was not deleted