1 README for libarchive bundle.
3 This distribution bundle includes the following components:
5 * libarchive: a library for reading and writing streaming archives
6 * tar: the 'bsdtar' program is a full-featured 'tar'
7 replacement built on libarchive
8 * cpio: the 'bsdcpio' program is a different interface to
9 essentially the same functionality
10 * examples: Some small example programs that you may find useful.
11 * examples/minitar: a compact sample demonstrating use of libarchive.
12 I use this for testing link pollution; it should produce a very
13 small executable file on most systems.
14 * contrib: Various items sent to me by third parties;
15 please contact the authors with any questions.
17 The top-level directory contains the following information files:
18 * NEWS - highlights of recent changes
19 * COPYING - what you can do with this
20 * INSTALL - installation instructions
22 * configure - configuration script, see INSTALL for details.
24 The following files in the top-level directory are used by the
27 * Makefile.am, aclocal.m4, configure.ac
28 - used to build this distribution, only needed by maintainers
29 * Makefile.in, config.h.in
30 - templates used by configure script
31 * config.aux/* - auxiliary scripts used by build system
33 Guide to Documentation installed by this system:
34 * bsdtar.1 explains the use of the bsdtar program
35 * bsdcpio.1 explains the use of the bsdcpio program
36 * libarchive.3 gives an overview of the library as a whole
37 * archive_read.3, archive_write.3, and archive_write_disk.3 provide
38 detailed calling sequences for the read and write APIs
39 * archive_entry.3 details the "struct archive_entry" utility class
40 * archive_internals.3 provides some insight into libarchive's
41 internal structure and operation.
42 * libarchive-formats.5 documents the file formats supported by the library
43 * cpio.5, mtree.5, and tar.5 provide detailed information about a
44 variety of different archive formats, including hard-to-find details
45 about modern cpio and tar variants.
47 You should also read the copious comments in "archive.h" and the source
48 code for the sample "bsdtar" program for more details. Please let me know
49 about any errors or omissions you find.
51 Currently, the library automatically detects and reads the following:
54 * compress/LZW compression
55 * GNU tar format (including GNU long filenames, long link names, and
57 * Solaris 9 extended tar format (including ACLs)
60 * POSIX pax interchange format
61 * POSIX octet-oriented cpio
63 * Binary cpio (big-endian or little-endian)
64 * ISO9660 CD-ROM images (with optional Rockridge extensions)
65 * ZIP archives (with uncompressed or "deflate" compressed entries)
66 * GNU and BSD 'ar' archives
69 The library can write:
73 * POSIX pax interchange format
74 * "restricted" pax format, which will create ustar archives except for
75 entries that require pax extensions (for long filenames, ACLs, etc).
76 * POSIX octet-oriented cpio
79 * GNU and BSD 'ar' archives
81 Notes about the library architecture:
83 * This is a heavily stream-oriented system. There is no direct
84 support for in-place modification or random access and no intention
85 of ever adding such support. Adding such support would require
86 sacrificing a lot of other features, so don't bother asking.
88 * The library is designed to be extended with new compression and
89 archive formats. The only requirement is that the format be
90 readable or writable as a stream and that each archive entry be
93 * On read, compression and format are always detected automatically.
95 * I've attempted to minimize static link pollution. If you don't
96 explicitly invoke a particular feature (such as support for a
97 particular compression or format), it won't get pulled in.
98 In particular, if you don't explicitly enable a particular
99 compression or decompression support, you won't need to link
100 against the corresponding compression or decompression libraries.
101 This also reduces the size of statically-linked binaries in
102 environments where that matters.
104 * On read, the library accepts whatever blocks you hand it.
105 Your read callback is free to pass the library a byte at a time[1]
106 or mmap the entire archive and give it to the library at once.
107 On write, the library always produces correctly-blocked output.
109 * The object-style approach allows you to have multiple archive streams
110 open at once. bsdtar uses this in its "@archive" extension.
112 * The archive itself is read/written using callback functions.
113 You can read an archive directly from an in-memory buffer or
114 write it to a socket, if you wish. There are some utility
115 functions to provide easy-to-use "open file," etc, capabilities.
117 * The read/write APIs are designed to allow individual entries
118 to be read or written to any data source: You can create
119 a block of data in memory and add it to a tar archive without
120 first writing a temporary file. You can also read an entry from
121 an archive and write the data directly to a socket. If you want
122 to read/write entries to disk, there are convenience functions to
123 make this especially easy.
125 * Note: "pax interchange format" is really an extended tar format,
126 despite what the name says.
128 [1] Gzip and compress formats are identical in the first byte.
129 For that reason, the first block must be at least two bytes if
130 you have both of these formats enabled at read time. This is
131 currently the only restriction on block size. (This restriction
132 could be lifted by buffering the initial blocks prior to the
133 compression tasting step, but it doesn't really seem worth the