1 $FreeBSD: src/lib/libarchive/README,v 1.3 2004/08/04 06:19:31 kientzle Exp $
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 and archive_write.3 provide detailed calling
10 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" program for more details. Please let me know
18 about any errors or omissions you find. (In particular, I no doubt missed
19 a few things when researching the tar.5 page.)
21 Currently, the library automatically detects and reads the following:
24 * compress/LZW 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)
35 The library can write:
39 * POSIX pax interchange format
40 * "restricted" pax format, which will create ustar archives except for
41 entries that require pax extensions (for long filenames, ACLs, etc).
42 * POSIX octet-oriented cpio
46 * This is a heavily stream-oriented system. There is no direct
47 support for in-place modification or random access and no intention
48 of ever adding such support. Adding such support would require
49 sacrificing a lot of other features, so don't bother asking.
51 * The library is designed to be extended with new compression and
52 archive formats. The only requirement is that the format be
53 readable or writable as a stream and that each archive entry be
56 * On read, compression and format are always detected automatically.
58 * I've attempted to minimize static link pollution. If you don't
59 explicitly invoke a particular feature (such as support for a
60 particular compression or format), it won't get pulled in.
61 In particular, if you don't explicitly enable a particular
62 compression or decompression support, you won't need to link
63 against the corresponding compression or decompression libraries.
64 This also reduces the size of statically-linked binaries in
65 environments where that matters.
67 * On read, the library accepts whatever blocks you hand it.
68 Your read callback is free to pass the library a byte at a time
69 or mmap the entire archive and give it to the library at once.
70 On write, the library always produces correctly-blocked
73 * The object-style approach allows you to have multiple archive streams
74 open at once. bsdtar uses this in its "@archive" extension.
76 * The archive itself is read/written using callback functions.
77 You can read an archive directly from an in-memory buffer or
78 write it to a socket, if you wish. There are some utility
79 functions to provide easy-to-use "open file," etc, capabilities.
81 * The read/write APIs are designed to allow individual entries
82 to be read or written to any data source: You can create
83 a block of data in memory and add it to a tar archive without
84 first writing a temporary file. You can also read an entry from
85 an archive and write the data directly to a socket. If you want
86 to read/write entries to disk, there are convenience functions to
87 make this especially easy.
89 * Note: "pax interchange format" is really an extended tar format,
90 despite what the name says.