packkit/ar

Unix ar archive encoder and decoder.

The encoder emits the BSD long-name variant (#1/N) so it can carry archive entries whose paths exceed 16 bytes or contain spaces. The decoder additionally accepts the GNU long-name variant (a leading // string-table member plus /<offset> references in entry headers), which is the form produced by binutils ar and present in nearly every .deb / .a on Linux. GNU symbol-table members (named /) are skipped transparently so they do not show up as user-visible entries.

Only regular file entries are supported - ar does not represent directories or symbolic links.

Values

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

Decode an ar byte stream using default limits.

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

Decode an ar byte stream using explicit limits.

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

Encode the logical archive to an ar byte stream.

pub fn format() -> archive.ArchiveFormat

AR archive format marker.

pub fn new() -> archive.Archive

Create an empty AR archive value.

Search Document