50a9d628f3068f3962b52b8906396eae4e4871e6
[dragonfly.git] / contrib / libarchive-2 / README
1 README for libarchive bundle.
2
3 This distribution bundle includes the following components:
4
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.
16
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
21    * README - this file
22    * configure - configuration script, see INSTALL for details.
23
24 The following files in the top-level directory are used by the
25 'configure' script:
26
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
32
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.
46
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.
50
51 Currently, the library automatically detects and reads the following:
52   * gzip compression
53   * bzip2 compression
54   * compress/LZW compression
55   * GNU tar format (including GNU long filenames, long link names, and
56     sparse files)
57   * Solaris 9 extended tar format (including ACLs)
58   * Old V7 tar archives
59   * POSIX ustar
60   * POSIX pax interchange format
61   * POSIX octet-oriented cpio
62   * SVR4 ASCII 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
67   * 'mtree' format
68
69 The library can write:
70   * gzip compression
71   * bzip2 compression
72   * compress/LZW compression
73   * POSIX ustar
74   * POSIX pax interchange format
75   * "restricted" pax format, which will create ustar archives except for
76     entries that require pax extensions (for long filenames, ACLs, etc).
77   * POSIX octet-oriented cpio
78   * SVR4 "newc" cpio
79   * shar archives
80   * GNU and BSD 'ar' archives
81
82 Notes about the library architecture:
83
84  * This is a heavily stream-oriented system.  There is no direct
85    support for in-place modification or random access and no intention
86    of ever adding such support.  Adding such support would require
87    sacrificing a lot of other features, so don't bother asking.
88
89  * The library is designed to be extended with new compression and
90    archive formats.  The only requirement is that the format be
91    readable or writable as a stream and that each archive entry be
92    independent.
93
94  * On read, compression and format are always detected automatically.
95
96  * I've attempted to minimize static link pollution.  If you don't
97    explicitly invoke a particular feature (such as support for a
98    particular compression or format), it won't get pulled in.
99    In particular, if you don't explicitly enable a particular
100    compression or decompression support, you won't need to link
101    against the corresponding compression or decompression libraries.
102    This also reduces the size of statically-linked binaries in
103    environments where that matters.
104
105  * On read, the library accepts whatever blocks you hand it.
106    Your read callback is free to pass the library a byte at a time[1]
107    or mmap the entire archive and give it to the library at once.
108    On write, the library always produces correctly-blocked output.
109
110  * The object-style approach allows you to have multiple archive streams
111    open at once.  bsdtar uses this in its "@archive" extension.
112
113  * The archive itself is read/written using callback functions.
114    You can read an archive directly from an in-memory buffer or
115    write it to a socket, if you wish.  There are some utility
116    functions to provide easy-to-use "open file," etc, capabilities.
117
118  * The read/write APIs are designed to allow individual entries
119    to be read or written to any data source:  You can create
120    a block of data in memory and add it to a tar archive without
121    first writing a temporary file.  You can also read an entry from
122    an archive and write the data directly to a socket.  If you want
123    to read/write entries to disk, there are convenience functions to
124    make this especially easy.
125
126  * Note: "pax interchange format" is really an extended tar format,
127    despite what the name says.
128
129 [1]  Gzip and compress formats are identical in the first byte.
130 For that reason, the first block must be at least two bytes if
131 you have both of these formats enabled at read time.  This is
132 currently the only restriction on block size.  (This restriction
133 could be lifted by buffering the initial blocks prior to the
134 compression tasting step, but it doesn't really seem worth the
135 effort.)