Deletes on-disk or in-memory directory at the given path. NOTE: Ensure that you have the required permissions to run this function.

directoryDelete(path[, recurse]) → returns void

directoryDelete Argument Reference

path string

Absolute path of the directory to be deleted. Alternatively, you can specify IP address, as in the following example: DirectoryDelete("//");.

recurse boolean
Default: false

If true, the directory and the sub-directories are deleted. If the directory (being deleted) has sub-directories and you set recurse to false, an exception occurs.

Examples sample code invoking the directoryDelete function

<cfset delDirectory = "someDirPath" />
<cfset recurse = true />
<cfset directoryDelete(delDirectory,recurse)>

Fork me on GitHub