remove#

remove(path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path]) None[source]#

Deletes a file or a directory (recursively) using shutil.rmtree or os.remove.

>>> path_to_remove = 'D:/path/to/remove'  # Could also be a file
>>> remove(path_to_remove)
path_to_remove deleted
Parameters

path (Union[str, CloudPath, Path]) – Path to be removed