pyrit.models.DiskStorageIO#
- class DiskStorageIO[source]#
Bases:
StorageIO
Implementation 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. :param path: The directory path to create. :type path: Path
- async is_file(path: Path | str) bool [source]#
Checks if the given path is a file (not a directory). :param path: The path to check. :type path: Path
- 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. :param path: The path to check. :type path: Path
- Returns:
True if the path exists, False otherwise.
- Return type: