3 libarchive: a library for reading and writing streaming archives
5 This is all under a BSD license. Use, enjoy, but don't blame me if it breaks!
8 * libarchive.3 gives an overview of the library as a whole
9 * archive_read.3, archive_write.3, and archive_write_disk.3 provide
10 detailed calling sequences for the read and write APIs
11 * archive_entry.3 details the "struct archive_entry" utility class
12 * libarchive-formats.5 documents the file formats supported by the library
13 * tar.5 provides some detailed information about a variety of different
16 You should also read the copious comments in "archive.h" and the source
17 code for the sample "bsdtar" and "minitar" programs for more details.
18 Please let me know about any errors or omissions you find.
20 Currently, the library automatically detects and reads the following:
23 * compress/LZW compression
24 * lzma and xz compression
25 * GNU tar format (including GNU long filenames, long link names, and
27 * Solaris 9 extended tar format (including ACLs)
30 * POSIX pax interchange format
31 * POSIX octet-oriented cpio
33 * Binary cpio (big-endian or little-endian)
34 * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
35 * ZIP archives (with uncompressed or "deflate" compressed entries)
36 * GNU and BSD 'ar' archives
39 The library can write:
42 * compress/LZW compression
43 * lzma and xz compression
45 * POSIX pax interchange format
46 * "restricted" pax format, which will create ustar archives except for
47 entries that require pax extensions (for long filenames, ACLs, etc).
48 * POSIX octet-oriented cpio
51 * ZIP archives (with uncompressed or "deflate" compressed entries)
52 * GNU and BSD 'ar' archives
56 * This is a heavily stream-oriented system. There is no direct
57 support for in-place modification or random access and no intention
58 of ever adding such support. Adding such support would require
59 sacrificing a lot of other features, so don't bother asking.
61 * The library is designed to be extended with new compression and
62 archive formats. The only requirement is that the format be
63 readable or writable as a stream and that each archive entry be
66 * On read, compression and format are always detected automatically.
68 * I've attempted to minimize static link pollution. If you don't
69 explicitly invoke a particular feature (such as support for a
70 particular compression or format), it won't get pulled in.
71 In particular, if you don't explicitly enable a particular
72 compression or decompression support, you won't need to link
73 against the corresponding compression or decompression libraries.
74 This also reduces the size of statically-linked binaries in
75 environments where that matters.
77 * On read, the library accepts whatever blocks you hand it.
78 Your read callback is free to pass the library a byte at a time
79 or mmap the entire archive and give it to the library at once.
80 On write, the library always produces correctly-blocked
83 * The object-style approach allows you to have multiple archive streams
84 open at once. bsdtar uses this in its "@archive" extension.
86 * The archive itself is read/written using callback functions.
87 You can read an archive directly from an in-memory buffer or
88 write it to a socket, if you wish. There are some utility
89 functions to provide easy-to-use "open file," etc, capabilities.
91 * The read/write APIs are designed to allow individual entries
92 to be read or written to any data source: You can create
93 a block of data in memory and add it to a tar archive without
94 first writing a temporary file. You can also read an entry from
95 an archive and write the data directly to a socket. If you want
96 to read/write entries to disk, the archive_write_disk interface
97 treats a directory as if it were an archive so you can copy
98 from archive->disk using the same code you use for archive->archive
101 * Note: "pax interchange format" is really an extended tar format,
102 despite what the name says.