rlike
  • Home
  • Reference
  • Tutorials
    • File operations
    • Saving
    • Text
    • Sets
    • More

unlink

unlink(path)

Delete an entire directory tree

Parameters

Name Type Description Default
path Union[str, List[str]] Path to a directory or a list of directories required

Returns

Name Type Description
Union[None, List[None]] the result of the call to shutil.rmtree or a list of these results in case path is a list

Examples

>>> from rlike import *
>>> folder = tempdir()
>>> a = tempfile(pattern = 'hello', fileext = '.txt', tmpdir = folder)
>>> b = tempfile(pattern = 'hello', fileext = '.txt', tmpdir = folder)
>>> test = list_files(folder)
>>> len(test)
2
>>> unlink(folder)
>>> file_exists([a, b])
[False, False]
>>> file_exists(folder)
False

rlike - © BNOSAC

 
  • Report an issue