packkit/tar

USTAR (POSIX 1003.1-1988) tar archive encoder and decoder.

The implementation is target-neutral and supports regular files, directories, symbolic links, and hard links. The encoder rejects names longer than the USTAR prefix/name split allows with a typed archive error. The decoder additionally consumes GNU LongName/LongLink extension entries (typeflags L and K), PAX extended attribute headers (x and g) — extracting the path / linkpath records so files emitted by tar --format=pax keep their full path past the USTAR 100-char limit — and skips the other PAX attribute keys.

Values

pub fn add_directory(
  archive archive_value: archive.Archive,
  path path: String,
) -> archive.Archive

Panicking counterpart of add_directory_checked.

pub fn add_directory_checked(
  archive archive_value: archive.Archive,
  path path: String,
) -> Result(archive.Archive, entry.EntryError)

Add a directory after checked path validation.

pub fn add_file(
  archive archive_value: archive.Archive,
  path path: String,
  body body: BitArray,
) -> archive.Archive

Panicking counterpart of add_file_checked.

pub fn add_file_checked(
  archive archive_value: archive.Archive,
  path path: String,
  body body: BitArray,
) -> Result(archive.Archive, entry.EntryError)

Add a regular file after checked path validation.

pub fn add_symlink(
  archive archive_value: archive.Archive,
  path path: String,
  target target: String,
) -> archive.Archive

Panicking counterpart of add_symlink_checked.

pub fn add_symlink_checked(
  archive archive_value: archive.Archive,
  path path: String,
  target target: String,
) -> Result(archive.Archive, entry.EntryError)

Add a symbolic link after checked path validation.

pub fn decode(
  bytes bytes: BitArray,
) -> Result(archive.Archive, error.ArchiveError)

Decode a USTAR byte stream into a logical archive using the default resource limits.

pub fn decode_with_limits(
  bytes bytes: BitArray,
  limits limits: limit.Limits,
) -> Result(archive.Archive, error.ArchiveError)

Decode a USTAR byte stream into a logical archive using the supplied resource limits.

pub fn encode(
  archive archive_value: archive.Archive,
) -> Result(BitArray, error.ArchiveError)

Encode a logical archive to a USTAR byte stream.

pub fn format() -> archive.ArchiveFormat

Tar archive format marker.

pub fn new() -> archive.Archive

Create an empty tar archive value.

Search Document