1 $FreeBSD: src/lib/libarchive/README,v 1.4 2005/02/12 23:09:44 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.
20 Currently, the library automatically detects and reads the following:
23 * compress/LZW compression
24 * GNU tar format (including GNU long filenames, long link names, and
26 * Solaris 9 extended tar format (including ACLs)
29 * POSIX pax interchange format
30 * POSIX octet-oriented cpio
32 * Binary cpio (big-endian or little-endian)
33 * ISO9660 CD-ROM images (with optional Rockridge extensions)
34 * ZIP archives (with uncompressed or "deflate" compressed entries)
36 The library can write:
40 * POSIX pax interchange format
41 * "restricted" pax format, which will create ustar archives except for
42 entries that require pax extensions (for long filenames, ACLs, etc).
43 * POSIX octet-oriented cpio
47 * This is a heavily stream-oriented system. There is no direct
48 support for in-place modification or random access and no intention
49 of ever adding such support. Adding such support would require
50 sacrificing a lot of other features, so don't bother asking.
52 * The library is designed to be extended with new compression and
53 archive formats. The only requirement is that the format be
54 readable or writable as a stream and that each archive entry be
57 * On read, compression and format are always detected automatically.
59 * I've attempted to minimize static link pollution. If you don't
60 explicitly invoke a particular feature (such as support for a
61 particular compression or format), it won't get pulled in.
62 In particular, if you don't explicitly enable a particular
63 compression or decompression support, you won't need to link
64 against the corresponding compression or decompression libraries.
65 This also reduces the size of statically-linked binaries in
66 environments where that matters.
68 * On read, the library accepts whatever blocks you hand it.
69 Your read callback is free to pass the library a byte at a time
70 or mmap the entire archive and give it to the library at once.
71 On write, the library always produces correctly-blocked
74 * The object-style approach allows you to have multiple archive streams
75 open at once. bsdtar uses this in its "@archive" extension.
77 * The archive itself is read/written using callback functions.
78 You can read an archive directly from an in-memory buffer or
79 write it to a socket, if you wish. There are some utility
80 functions to provide easy-to-use "open file," etc, capabilities.
82 * The read/write APIs are designed to allow individual entries
83 to be read or written to any data source: You can create
84 a block of data in memory and add it to a tar archive without
85 first writing a temporary file. You can also read an entry from
86 an archive and write the data directly to a socket. If you want
87 to read/write entries to disk, there are convenience functions to
88 make this especially easy.
90 * Note: "pax interchange format" is really an extended tar format,
91 despite what the name says.