hbutils.system.filesystem

Overview:

Utilities for filesystem.

touch

hbutils.system.filesystem.touch(file: str, exist_ok: bool = True, makedirs: bool = True)[source]
Overview:

Touch the file at given path. Just like the touch command in unix system.

Parameters:
  • file – Path of the file.

  • exist_ok – Exist is okay or not.

  • makedirs – Create directories when necessary.

copy

hbutils.system.filesystem.copy(src: str, dst: str)[source]
Overview:

Copy a file or a directory from src to dst. src can be a file or a directory, both are supported.

From Stack Overflow - Copy file or directories recursively in Python.

Parameters:
  • src – Source path.

  • dst – Destination path.

remove

hbutils.system.filesystem.remove(file: str)[source]
Overview:

Remove a file or a directory at file. file can be a file or a directory, both are supported.

Parameters:

file – File or directory to be removed.