Dpkg::Archive::Ar(3perl) libdpkg-perl Dpkg::Archive::Ar(3perl)

# [NAME](#NAME)

Dpkg::Archive::Ar - Unix ar archive support

# [DESCRIPTION](#DESCRIPTION)

This module provides a class to handle Unix ar archives. It support the common format, with no GNU or BSD extensions.

**Note**: This is a private module, its API can change at any time.

# [METHODS](#METHODS)

$ar = Dpkg::Archive::Ar-&gt;new(%opts)

Create a new object to handle Unix ar archives.

Options:

[**filename**](#filename)

The filename for the archive to open or create.

[**create**](#create)

A boolean denoting whether the archive should be created, otherwise if it does not exist the constructor will not open, create or scan it.

$ar-&gt;create\_archive($filename)

Create the archive.

$ar-&gt;open\_archive($filename)

Open the archive.

$ar-&gt;**parse\_magic()**

Reads and parses the archive magic string, and validates it.

$ar-&gt;**parse\_member()**

Reads and parses the archive member and tracks it for later handling.

$ar-&gt;skip\_member($member)

Skip this member to the next one. Get the value of a given substitution.

$ar-&gt;**scan\_archive()**

Scan the archive for all its member files and metadata.

$ar-&gt;**get\_members()**

Get the list of members in the archive.

$ar-&gt;extract\_member($member)

Extract the specified member to the current directory.

$ar-&gt;write\_member($member)

Write the provided $member into the archive.

$ar-&gt;add\_file($filename)

Append the specified $filename into the archive.

$ar-&gt;**close\_archive()**

Close the archive and release any allocated resource.

# [CHANGES](#CHANGES)

## [Version 0.xx](#Version_0.xx)

This is a private module.

2026-09-09 1.23.11-dirty

---

Document: Dpkg::Archive::Ar(3perl) from dpkg 1.23.11-r0 (Chainguard OS)
Source: https://git.dpkg.org/git/dpkg/dpkg.git
