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
Basic Examples (1)
Delete a directory specified as a File object:
Introduced in 1991
|Updated in 2016