amejia1 edited this page Feb 4, 2012 · 2 revisions
Clone this wiki locally

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


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 (read and write)
  • separate command-line compressors with fixed-signature auto-detection
  • xz, lzip, and lzma (read and write using liblzma)
  • lzma (if you lack liblzma, you can get read-only lzma support through the lzmadec library; this will likely be dropped when liblzma is stable and widely-available)
  • 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, starting in libarchive 2.8)
  • xar (read only, starting in libarchive 2.8)
  • lha/lzh (read only, starting in libarchive 3.0)
  • rar (read only, starting in libarchive 3.0)
  • Microsoft CAB format (read only, starting in libarchive 3.0)
  • 7-Zip (read only, starting in libarchive 3.0)