acquire.acquire.volatilestream

Module Contents

Classes

VolatileStream

Streaming class to handle various procfs and sysfs edge-cases. Backed by AlignedStream.

Attributes

acquire.acquire.volatilestream.HAS_FCNTL = True
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.

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().