pi_portal.modules.system.file_system.FileSystem

class pi_portal.modules.system.file_system.FileSystem(path: str)[source]

Bases: object

An object on the local file system.

Parameters:

path (str) – A path on the local file system.

__init__(path: str) None[source]
create(directory: bool = False) None[source]

Ensure the path exists as either a directory or file.

Parameters:

directory (bool) – A boolean indicating whether the target is a directory.

ownership(user: str, group: str) None[source]

Set the owner and group of the file path in question.

Parameters:
  • user (str) – The Linux user to set ownership to.

  • group (str) – The Linux group to set ownership to.

permissions(mode: str) None[source]

Set the file system permissions for the file path in question.

Parameters:

mode (str) – A three digit octal permission.

wait_until_exists() None[source]

Wait until the specified file path exists.