rmdir()

audeer.rmdir(path, *paths, follow_symlink=True)[source]

Remove directory.

Remove the directory and all its content if the directory exists.

Parameters
  • path (Union[str, bytes]) – absolute or relative path of directory to remove

  • *paths (Sequence[Union[str, bytes]]) – additional arguments to be joined with path by os.path.join()

  • follow_symlink (bool) – if True and path is a symbolic link, the link and the folder it points to will be removed

Raises

Examples

>>> _ = mkdir("path1", "path2", "path3")
>>> list_dir_names("path1", basenames=True)
['path2']
>>> rmdir("path1", "path2")
>>> list_dir_names("path1")
[]