Reference articles on history, science, culture and more
Encyclopedia

Libarchive

Open-source archive and compression library

libarchive is a free and open-source library for reading and writing various archive and compression formats. It is written in C and works on most Unix-like systems and Windows.

01History

libarchive's development was started in 2003 as part of the FreeBSD project. During the early years it was led by the FreeBSD project, but later it became an independent project. It was first released with FreeBSD 5.3 in November 2004.

02libarchive

libarchive automatically detects and reads archive formats. If the archive is compressed, libarchive also detects and handles compression formats before evaluating the archive. libarchive is designed to minimize the copying of data internally for optimal performance.

Supported archive formats:

  • 7z, read and write
  • ar, read and write
  • cab, read only
  • cpio, read and write
  • ISO9660, read and write
  • lha & lzh, read only
  • pax, read and write
  • rar, read only
  • shar, write only
  • tar, read and write
  • warc (ISO 28500:2009), read and write
  • xar, read and write
  • zip, read and write

03Utilities

libarchive provides command-line utilities called bsdtar and bsdcpio. These are complete re-implementation based on libarchive. These are the default system tar and cpio on FreeBSD, NetBSD, macOS and Windows.

There is also bsdcat, designed to decompress a file to the standard output like zcat.

04Users

libarchive was originally developed for FreeBSD, but is also used in NetBSD and macOS as part of those operating systems.

bsdtar has been included in Windows since Windows 10 April 2018 Update. In May 2023, Microsoft announced Windows 11 will natively support additional archive formats such as 7z and RAR via libarchive.

Watch videos about LibarchiveExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Libarchive, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.