rmdir()¶
- audeer.rmdir(path, *paths, follow_symlink=True)[source]¶
Remove directory.
Remove the directory and all its content if the directory exists.
- Parameters
- Raises
NotADirectoryError – if path is not a directory
OSError – if
follow_symlink
isFalse
andpath
is a symbolic link
Examples
>>> path = audeer.mkdir("path1") >>> _ = audeer.mkdir(path, "path2", "path3") >>> audeer.list_dir_names(path, basenames=True) ['path2'] >>> audeer.rmdir(path, "path2") >>> audeer.list_dir_names(path) []