txt: ## rmdir.md
  rmdir
  
  Combined from primary sources listed below.
  
  # [In IO::Path](#___top "go to top of document")[§](#(IO::Path)_routine_rmdir "direct link")
  
  See primary documentation
  [in context](/type/IO/Path#routine_rmdir)
  for **routine rmdir**.
  
  ```raku
  sub    rmdir(*@dirs --> List:D)
  method rmdir(IO::Path:D: --> True)
  ```
  
  Remove the invocant, or in sub form, all of the provided directories in the given list, which can contain any [`Cool`](/type/Cool) object. Only works on empty directories.
  
  Method form returns `True` on success and returns a [`Failure`](/type/Failure) of type [`X::IO::Rmdir`](/type/X/IO/Rmdir) if the directory cannot be removed (e.g. the directory is not empty, or the path is not a directory). Subroutine form returns a list of directories that were successfully deleted.
  
  To delete non-empty directory, see [rmtree in `File::Directory::Tree` module](https://github.com/labster/p6-file-directory-tree).
  