FilePath

class ostools.FilePath(path='.', exist_required=True, ensure=None, lazy=False)[source]

This is a class similar to pathlib.Path.

path_list

list – The list of elements in the path. This can be modified manually.

exist_required

bool – Whether or not this path must exist. This can be modified manually.

ensure

str – Whether to create the file or directory automatically. Can be either ‘dir’, to make it a directory, or ‘file’ to make it a file. It will be created before the FilePath.exist_required check. This can be modified manually.

lazy

bool – Whether or not to run FilePath.ensure and FilePath.exist_required checks when accessing or modifying FilePath.path(). This can be modified manually.