RemoveDirectory - Maple Help

FileTools

 RemoveDirectory
 remove a directory

 Calling Sequence RemoveDirectory(dirName, options)

Parameters

 dirName - string ; directory name to be removed options - (optional) equation(s) of the form name = value

Returns

 • none

Options

 • recurse=true or false
 Specifies whether the directory removal should be carried out recursively. If recurse=false, then the RemoveDirectory command can only remove an empty directory. Default is false.
 • forceremove=true or false
 Specifies whether the directory removal should be forced. If forceremove=false, then the RemoveDirectory command will display a dialog which queries the user about whether the directory should be removed. Default is false.

Description

 • The RemoveDirectory command removes a directory

Notes

 • Symbolic links to directories are treated and removed as files. (That is, no recursion is carried into the link target directory.)
 • dirName is not allowed to be "." or ".."
 • If used carelessly, this command could cause loss of important data. Please use with care!

Examples

 > $\mathrm{mkdir}\left("mydir"\right)$
 > $\mathrm{mkdir}\left("mydir/subdir"\right)$
 > $\mathrm{FileTools}:-\mathrm{Text}:-\mathrm{WriteLine}\left("mydir/subdir/testfile","this is a test"\right)$
 ${15}$ (1)
 > $\mathrm{FileTools}:-\mathrm{Text}:-\mathrm{Close}\left("mydir/subdir/testfile"\right)$
 > $\mathrm{FileTools}:-\mathrm{RemoveDirectory}\left("mydir",\mathrm{recurse}=\mathrm{true},\mathrm{forceremove}=\mathrm{true}\right)$
 > $\mathrm{FileTools}:-\mathrm{Exists}\left("mydir"\right)$
 ${\mathrm{false}}$ (2)

Compatibility

 • The FileTools[RemoveDirectory] command was introduced in Maple 16.