vis4d.data.io.file
Standard backend for local files on a hard drive.
This backends loads data from and saves data to the local hard drive.
Classes
Raw file from hard disk data backend. |
- class FileBackend[source]
Raw file from hard disk data backend.
- isfile(filepath)[source]
Check if filepath is a file.
- Parameters:
filepath (str) – Path to file.
- Returns:
True if file exists, False otherwise.
- Return type:
bool
- listdir(filepath)[source]
List all files in the directory.
- Parameters:
filepath (str) – Path to file.
- Returns:
List of all files in the directory.
- Return type:
list[str]
- exists(filepath)[source]
Check if filepath exists.
- Parameters:
filepath (str) – Path to file.
- Returns:
True if file exists, False otherwise.
- Return type:
bool
- set(filepath, content, mode='w')[source]
Write the file content to disk.
- Parameters:
filepath (str) – Path to file.
content (bytes) – Content to write in bytes.
mode (Literal["w", "a"], optional) – Overwrite or append mode. Defaults to “w”.
- Return type:
None