acquire.acquire.outputs.tar

Module Contents

Classes

TarOutput

Tar archive acquire output format. Output can be compressed and/or encrypted.

class acquire.acquire.outputs.tar.TarOutput(path: pathlib.Path, compress: bool = False, encrypt: bool = False, public_key: bytes | None = None)

Bases: acquire.outputs.base.Output

Tar archive acquire output format. Output can be compressed and/or encrypted.

Parameters:
  • path – The path to write the tar archive to.

  • compress – Whether to compress the tar archive.

  • encrypt – Whether to encrypt the tar archive.

  • public_key – The RSA public key to encrypt the header with.

write(output_path: str, fh: BinaryIO, entry: dissect.target.filesystem.FilesystemEntry | pathlib.Path | None = None, size: int | None = None) None

Write a file-like object to a tar file.

The data from fh is written, while entry is used to get some properties of the file.

Parameters:
  • output_path – The path of the entry in the output.

  • fh – The file-like object of the entry to write.

  • entry – The optional filesystem entry to write.

  • size – The optional file size in bytes of the entry to write.

close() None

Closes the tar file.