cement.utils.fs

Common File System Utilities.

cement.utils.fs.abspath(path)

Return an absolute path, while also expanding the ‘~’ user directory shortcut.

Parameters:path – The original path to expand.
Return type:str
cement.utils.fs.backup(path, suffix='.bak')

Rename a file or directory safely without overwriting an existing backup of the same name.

Parameters:
  • path – The path to the file or directory to make a backup of.
  • suffix – The suffix to rename files with.
Returns:

The new path of backed up file/directory

Return type:

str