acquire.acquire.volatilestream
¶
Module Contents¶
Classes¶
Streaming class to handle various procfs and sysfs edge-cases. Backed by AlignedStream. |
Functions¶
Timeout a function if it takes too long to complete. |
Attributes¶
- acquire.acquire.volatilestream.HAS_FCNTL = True¶
- acquire.acquire.volatilestream.timeout(func: Callable, *, timelimit: int) Callable ¶
Timeout a function if it takes too long to complete.
- Parameters:
func – a function to wrap.
timelimit – The time in seconds that an operation is allowed to run.
- Raises:
TimeoutError – If its time exceeds the timelimit
- class acquire.acquire.volatilestream.VolatileStream(path: pathlib.Path, mode: str = 'rb', flags: int = os.O_RDONLY | getattr(os, 'O_NOATIME', 0) | getattr(os, 'O_NONBLOCK', 0), size: int = 1024 * 1024 * 5)¶
Bases:
dissect.util.stream.AlignedStream
Streaming class to handle various procfs and sysfs edge-cases. Backed by AlignedStream.
- Parameters:
path – Path of the file to obtain a file-handle from.
mode – Mode string to open the file-handle with. Such as “rt” and “rb”.
flags – Flags to open the file-descriptor with.
size – The maximum size of the stream. None if unknown.
- fh¶
- fd¶
- seek(pos: int, whence: int = SEEK_SET) int ¶
Seek the stream to the specified position.
- seekable() bool ¶
Return whether object supports random access.
If False, seek(), tell() and truncate() will raise OSError. This method may need to do a test seek().