Welcome to libarchive!
The libarchive project develops a portable, efficient C library that
can read and write streaming archives in a variety of formats. It
also includes implementations of the common tar, cpio, and zcat
command-line tools that use the libarchive library.
Questions? Issues?
Contents of the Distribution
This distribution bundle includes the following major components:
- libarchive: a library for reading and writing streaming archives
- tar: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive
- cpio: the 'bsdcpio' program is a different interface to essentially the same functionality
- cat: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such
- unzip: the 'bsdunzip' program is a simple replacement tool for Info-ZIP's unzip
- examples: Some small example programs that you may find useful.
- examples/minitar: a compact sample demonstrating use of libarchive.
- contrib: Various items sent to me by third parties; please contact the authors with any questions.
The top-level directory contains the following information files:
- NEWS - highlights of recent changes
- COPYING - what you can do with this
- INSTALL - installation instructions
- README - this file
- CMakeLists.txt - input for "cmake" build tool, see INSTALL
- configure - configuration script, see INSTALL for details. If your copy of the source lacks a
configure script, you can try to construct it by running the script in build/autogen.sh (or use cmake).
The following files in the top-level directory are related to the 'configure' script and are only needed by maintainers:
configure.ac - used (by autoconf) to build the configure script and related files
Makefile.am - used (by automake) to generate Makefile.in
aclocal.m4 - auto-generated file (created by aclocal) used to build the configure script
Makefile.in - auto-generated template (created by automake) used by the configure script to create Makefile
config.h.in - auto-generated template (created by autoheader) used by the configure script to create config.h
Documentation
In addition to the informational articles and documentation
in the online libarchive Wiki,
the distribution also includes a number of manual pages:
- bsdtar.1 explains the use of the bsdtar program
- bsdcpio.1 explains the use of the bsdcpio program
- bsdcat.1 explains the use of the bsdcat program
- libarchive.3 gives an overview of the library as a whole
- archive_read.3, archive_write.3, archive_write_disk.3, and
archive_read_disk.3 provide detailed calling sequences for the read
and write APIs
- archive_entry.3 details the "struct archive_entry" utility class
- archive_internals.3 provides some insight into libarchive's
internal structure and operation.
- libarchive-formats.5 documents the file formats supported by the library
- cpio.5, mtree.5, and tar.5 provide detailed information about these
popular archive formats, including hard-to-find details about
modern cpio and tar variants.
The manual pages above are provided in the 'doc' directory in
a number of different formats.
You should also read the copious comments in archive.h and the
source code for the sample programs for more details. Please let us
know about any errors or omissions you find.
Supported Formats
Currently, the library automatically detects and reads the following formats:
- Old V7 tar archives
- POSIX ustar
- GNU tar format (including GNU long filenames, long link names, and sparse files)
- Solaris 9 extended tar format (including ACLs)
- POSIX pax interchange format
- POSIX octet-oriented cpio
- SVR4 ASCII cpio
- Binary cpio (big-endian or little-endian)
- PWB binary cpio
- ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
- ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives)
- ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries)
- GNU and BSD 'ar' archives
- 'mtree' format
- 7-Zip archives (including archives that use zstandard compression)
- Microsoft CAB format
- LHA and LZH archives
- RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status)
- WARC archives
- XAR archives
The library also detects and handles any of the following before evaluating the archive:
- uuencoded files
- files with RPM wrapper
- gzip compression
- bzip2 compression
- compress/LZW compression
- lzma, lzip, and xz compression
- lz4 compression
- lzop compression
- zstandard compression
The library can create archives in any of the following formats:
- POSIX ustar
- POSIX pax interchange format
- "restricted" pax format, which will create ustar archives except for
entries that require pax extensions (for long filenames, ACLs, etc).
- Old GNU tar format
- Old V7 tar format
- POSIX octet-oriented cpio
- SVR4 "newc" cpio
- Binary cpio (little-endian)
- PWB binary cpio
- shar archives
- ZIP archives (with uncompressed or "deflate" compressed entries)
- ZIPX archives (with bzip2, zstd, lzma or xz compressed entries)
- GNU and BSD 'ar' archives
- 'mtree' format
- ISO9660 format
- 7-Zip archives (including archives that use zstandard compression)
- WARC archives
- XAR archives
When creating archives, the result can be filtered with any of the following:
This is the beginning of the README. Read the rest at the original. Read the full README ↗