Browse files

Add some mention of new formats to libarchive-formats.5 and libarchive.3

  • Loading branch information...
1 parent 6123cd7 commit c6508ec53bc0bfdd176069f2e9a37fb590328dc6 @kientzle kientzle committed Mar 21, 2012
Showing with 137 additions and 32 deletions.
  1. +87 −17 libarchive/libarchive-formats.5
  2. +50 −15 libarchive/libarchive.3
@@ -24,7 +24,7 @@
.\" $FreeBSD$
-.Dd December 23, 2011
+.Dd March 18, 2012
@@ -51,11 +51,11 @@ functions to enable all supported formats.
.Xr libarchive 3
library can read most tar archives.
-However, it only writes POSIX-standard
+It can write POSIX-standard
.Dq ustar
.Dq pax interchange
+formats and a subset of the legacy GNU tar format.
All tar formats store each entry in one or more 512-byte records.
The first record is used for file metadata, including filename,
@@ -70,13 +70,18 @@ subsequent entries.
.It Cm gnutar
.Xr libarchive 3
-library can read GNU-format tar archives.
+library can read most GNU-format tar archives.
It currently supports the most popular GNU extensions, including
modern long filename and linkname support, as well as atime and ctime data.
The libarchive library does not support multi-volume
archives, nor the old GNU long filename format.
It can read GNU sparse file entries, including the new POSIX-based
-formats, but cannot write GNU sparse file entries.
+.Xr libarchive 3
+library can write GNU tar format, including long filename
+and linkname support, as well as atime and ctime data.
.It Cm pax
.Xr libarchive 3
@@ -98,6 +103,14 @@ archiver and a few LIBARCHIVE keys.
The libarchive library can read most of the SCHILY keys
and most of the GNU keys introduced by GNU tar.
It silently ignores any keywords that it does not understand.
+The pax interchange format converts filenames to Unicode
+and stores them using the UTF-8 encoding.
+Prior to libarchive 3.0, libarchive erroneously assumed
+that the system wide-character routines natively supported
+This caused it to mis-handle non-ASCII filenames on systems
+that did not satisfy this assumption.
.It Cm restricted pax
The libarchive library can also write pax archives in which it
attempts to suppress the extended attributes entry whenever
@@ -135,6 +148,8 @@ security information cannot be stored.
Archive entries are limited to 8 gigabytes in size.
Note that the pax interchange format has none of these restrictions.
+The ustar format is old and widely supported.
+It is recommended when compatibility is the primary concern.
The libarchive library also reads a variety of commonly-used extensions to
@@ -268,19 +283,68 @@ If both extensions are present, the Joliet extensions will be
used and the Rockridge extensions will be ignored.
In particular, this can create problems with hardlinks and symlinks,
which are supported by Rockridge but not by Joliet.
+Libarchive reads ISO9660 images using a streaming strategy.
+This allows it to read compressed images directly
+(decompressing on the fly) and allows it to read images
+directly from network sockets, pipes, and other non-seekable
+data sources.
+This strategy works well for optimized ISO9660 images created
+by many popular programs.
+Such programs collect all directory information at the beginning
+of the ISO9660 image so it can be read from a physical disk
+with a minimum of seeking.
+However, not all ISO9660 images can be read in this fashion.
+Libarchive can also write ISO9660 images.
+Such images are fully optimized with the directory information
+preceding all file data.
+This is done by storing all file data to a temporary file
+while collecting directory information in memory.
+When the image is finished, libarchive writes out the
+directory structure followed by the file data.
+The location used for the temporary file can be changed
+by the usual environment variables.
.Ss Zip format
Libarchive can read and write zip format archives that have
uncompressed entries and entries compressed with the
.Dq deflate
-Older zip compression algorithms are not supported.
-It can extract jar archives, archives that use Zip64 extensions and many
+Other zip compression algorithms are not supported.
+It can extract jar archives, archives that use Zip64 extensions and
self-extracting zip archives.
-Libarchive reads Zip archives as they are being streamed,
-which allows it to read archives of arbitrary size.
-It currently does not use the central directory; this
-limits libarchive's ability to support some self-extracting
-archives and ones that have been modified in certain ways.
+Libarchive can use either of two different strategies for
+reading Zip archives:
+a streaming strategy which is fast and can handle extremely
+large archives, and a seeking strategy which can correctly
+process self-extracting Zip archives and archives with
+deleted members or other in-place modifications.
+The streaming reader processes Zip archives as they are read.
+It can read archives of arbitrary size from tape or
+network sockets, and can decode Zip archives that have
+been separately compressed or encoded.
+However, self-extracting Zip archives and archives with
+certain types of modifications cannot be correctly
+Such archives require that the reader first process the
+Central Directory, which is ordinarily located
+at the end of a Zip archive and is thus inaccessible
+to the streaming reader.
+If the program using libarchive has enabled seek support, then
+libarchive will use this to processes the central directory first.
+In particular, the seeking reader must be used to
+correctly handle self-extracting archives.
+Such archives consist of a program followed by a regular
+Zip archive.
+The streaming reader cannot parse the initial program
+portion, but the seeking reader starts by reading the
+Central Directory from the end of the archive.
+Similarly, Zip archives that have been modified in-place
+can have deleted entries or other garbage data that
+can only be accurately detected by first reading the
+Central Directory.
.Ss Archive (library) file format
The Unix archive format (commonly created by the
.Xr ar 1
@@ -342,12 +406,18 @@ using libarchive.
If it cannot locate and open the file on disk, libarchive
will return an error for any attempt to read the entry
+.Ss LHA
+XXX Information about libarchive's LHA support XXX
+.Ss CAB
+XXX Information about libarchive's CAB support XXX
+.Ss XAR
+XXX Information about libarchive's XAR support XXX
-libarchive has limited support to read files in RAR format. Currently,
-libarchive can read single RAR files in RARv3 format which have been either
-created uncompressed, or compressed using any of the compression methods
-supported by the RARv3 format. libarchive can also extract RAR files which have
-been created as self-extracting RAR files.
+Libarchive has limited support for reading RAR format archives.
+Currently, libarchive can read RARv3 format archives
+which have been either created uncompressed, or compressed using
+any of the compression methods supported by the RARv3 format.
+Libarchive can also read self-extracting RAR archives.
.Xr ar 1 ,
.Xr cpio 1 ,
@@ -24,7 +24,7 @@
.\" $FreeBSD$
-.Dd February 2, 2012
+.Dd March 18, 2012
@@ -64,15 +64,33 @@ most common cpio archive formats,
ISO9660 CD images (including RockRidge and Joliet extensions),
-Zip archives.
+Zip archives,
+ar archives (including GNU/SysV and BSD extensions),
+Microsoft CAB archives,
+LHA archives,
+mtree file tree descriptions,
+RAR archives,
+XAR archives.
The library automatically detects archives compressed with
.Xr gzip 1 ,
.Xr bzip2 1 ,
.Xr xz 1 ,
+.Xr lzip 1 ,
.Xr compress 1
and decompresses them transparently.
+It can similarly detect and decode archives processed with
+.Xr uuencode 1
+or which have an
+.Xr rpm 1
When writing an archive, you can specify the compression
to be used and the format to use.
@@ -91,7 +109,17 @@ POSIX octet-oriented cpio archives,
Zip archive,
-two different variants of shar archives.
+two different variants of shar archives,
+ISO9660 CD images,
+7-Zip archives,
+ar archives,
+mtree file tree descriptions,
+XAR archives.
Pax interchange format is an extension of the tar archive format that
eliminates essentially all of the limitations of historic tar formats
@@ -143,9 +171,21 @@ operations.
.Xr archive_read_disk 3
-provides some support for populating
+supports for populating
.Xr archive_entry 3
objects from information in the filesystem.
+This includes the information accessible from the
+.Xr stat 2
+system call as well as ACLs, extended attributes,
+and other metadata.
+.Xr archive_read_disk 3
+API also supports iterating over directory trees,
+which allows directories of files to be read using
+an API compatible with
+.Xr archive_read 3
Detailed descriptions of each function are provided by the
corresponding manual pages.
@@ -225,7 +265,7 @@ library first appeared in
.An -nosplit
.Nm libarchive
-library was written by
+library was originally written by
.An Tim Kientzle Aq .
Some archive formats support information that is not supported by
@@ -242,13 +282,8 @@ is supported by all formats.
For example, cpio formats do not support nanosecond timestamps;
old tar formats do not support large device numbers.
-.Xr archive_read_disk 3
-API should support iterating over filesystems;
-that would make it possible to share code among
-disk-to-archive, archive-to-archive, archive-to-disk,
-and disk-to-disk operations.
-Currently, it only supports reading the
-information for a single file.
-(Which is still quite useful, as it hides a lot
-of system-specific details.)
+The ISO9660 reader cannot yet read all ISO9660 images;
+it should learn how to seek.
+The AR writer requires the client program to use
+two passes, unlike all other libarchive writers.

0 comments on commit c6508ec

Please sign in to comment.