Skip to content
Martin Matuška edited this page Jan 17, 2020 · 3 revisions

Summary of formats supported by the library and command-line tools.

Introduction

Libarchive is highly modular. It was designed from the beginning to make it relatively easy to add new archive formats and compression algorithms. Note, however, that each program that uses libarchive chooses which formats it wants to use, so support in libarchive does not guarantee support in any particular program. Of course, the bsdtar and bsdcpio programs included in the libarchive distribution do enable all libarchive formats by default.

For developers: Note that libarchive is modularized in such a way that statically-linked executables pay nothing for formats that they don't use. If you choose to omit a particular format, no code for that format will be linked into your program. In particular, you only need zlib, bzlib, or lzma libraries if you specifically enable the corresponding formats. (This is not true if you use dynamic libraries, of course.)

Filter Support

The read pipeline automatically recognizes archives processed with any combination of the following. Libarchive 3.0 supports multiple filters when writing archives.

  • gzip (read and write, uses zlib)
  • bzip2 (read and write, uses bzlib)
  • compress (read and write, uses an internal implementation)
  • uudecode and base64 (read and write)
  • separate command-line compressors with fixed-signature auto-detection
  • xz, lzip, and lzma (read and write using liblzma)
  • Most of the above fall back to using command-line tools if the libraries were unavailable at build time. Due to the additional overhead, the command-line tools are usually slower than using the libraries directly.

Archive Formats Supported

  • tar (read and write, including GNU extensions)
  • pax (read and write, including GNU and star extensions)
  • cpio (read and write, including odc, newc, and afio variants)
  • ISO9660 (read and write, including Joliet and Rockridge extensions, with some limitations)
  • zip (read and write, with some limitations, uses zlib)
  • mtree (read and write, uses separate libraries for creating and verifying cryptographic hashes)
  • shar (write only)
  • ar (read and write, including BSD and GNU/SysV variants)
  • empty (read only; in particular, note that no other format will accept an empty file)
  • raw (read only)
  • xar (read and write)
  • lha/lzh (read only)
  • rar (read only, original and RAR v5 format)
  • Microsoft CAB format (read only)
  • 7-Zip (read and write)
  • WARC (ISO 28500:2009, read and write)