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.
Examplesopen allclose all
Introduced in 1991
(2.0)| Updated in 2016