pyrit.models.DiskStorageIO#
- class DiskStorageIO[source]#
Bases:
StorageIOImplementation of StorageIO for local disk storage.
- __init__()#
Methods
__init__()Asynchronously creates a directory if it doesn't exist on the local disk.
is_file(path)Checks if the given path is a file (not a directory).
path_exists(path)Checks if a path exists on the local disk.
read_file(path)Asynchronously reads a file from the local disk.
write_file(path, data)Asynchronously writes data to a file on the local disk.
- async create_directory_if_not_exists(path: Path | str) None[source]#
Asynchronously creates a directory if it doesn’t exist on the local disk.
- Parameters:
path (Path) – The directory path to create.
- async is_file(path: Path | str) bool[source]#
Checks if the given path is a file (not a directory).
- Parameters:
path (Path) – The path to check.
- Returns:
True if the path is a file, False otherwise.
- Return type:
- async path_exists(path: Path | str) bool[source]#
Checks if a path exists on the local disk.
- Parameters:
path (Path) – The path to check.
- Returns:
True if the path exists, False otherwise.
- Return type: