DeleteDirectory
DeleteDirectory["dir"]
deletes the specified directory.
Details and Options
- DeleteDirectory["dir",DeleteContents->True] deletes dir and all files and directories that it contains.
- DeleteDirectory["dir"] deletes the directory dir only if it contains no files.
- DeleteDirectory[File["dir"],…] is also supported.
- DeleteDirectory returns Null if it succeeds in deleting a directory, and $Failed if it fails.
Examples
open allclose allBasic Examples (1)
Scope (1)
Delete a directory specified as a File object:
Wolfram Research (1991), DeleteDirectory, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteDirectory.html (updated 2016).
Text
Wolfram Research (1991), DeleteDirectory, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteDirectory.html (updated 2016).
CMS
Wolfram Language. 1991. "DeleteDirectory." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/DeleteDirectory.html.
APA
Wolfram Language. (1991). DeleteDirectory. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeleteDirectory.html