Documentation for sub rmdir
Documentation for sub rmdir, assembled from the following types:
sub rmdir(IO --> Bool)method rmdir(IO::Path: --> Bool)
Remove the given directory if it is empty.
True on success. Throws an exception of type X::IO::Rmdir if the directory cannot be removed (e.g. the directory is not empty, or the path is not a directory).
Since this only works on an empty directory, to remove a directory and its contents you will have to do something more complex.
# When we have a directory first recurse, then remove itmulti sub rm-all(IO::Path where :d)# Otherwise just remove the thing directlymulti sub rm-all(IO::Path )
See also rmtree in File::Directory::Tree.