Main index | Section 3 | Options |
When reading an archive, the library automatically detects the format and the compression. The library currently has read support for:
When writing an archive, you can specify the compression to be used and the format to use. The library can write
The read and write APIs are accessed through the archive_read_XXX() functions and the archive_write_XXX() functions, respectively, and either can be used independently of the other.
The rest of this manual page provides an overview of the library operation. More detailed information can be found in the individual manual pages for each API or utility function.
All of the functions utilize an opaque struct archive datatype that provides access to the archive contents.
The struct archive_entry structure contains a complete description of a single archive entry. It uses an opaque interface that is fully documented in archive_entry(3).
Users familiar with historic formats should be aware that the newer variants have eliminated most restrictions on the length of textual fields. Clients should not assume that filenames, link names, user names, or group names are limited in length. In particular, pax interchange format can easily accommodate pathnames in arbitrary character sets that exceed PATH_MAX.
archive_read_new() and archive_write_new() return pointers to an allocated and initialized struct archive object.
archive_read_data() and archive_write_data() return a count of the number of bytes actually read or written. A value of zero indicates the end of the data for this entry. A negative value indicates an error, in which case the archive_errno() and archive_error_string() functions can be used to obtain more information.
Conversely, of course, not all of the information that can be stored in an struct archive_entry is supported by all formats. For example, cpio formats do not support nanosecond timestamps; old tar formats do not support large device numbers.
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.
LIBARCHIVE (3) | March 18, 2012 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | A UNIX saleslady, Lenore, Enjoys work, but she likes the beach more. She found a good way To combine work and play: She sells C shells by the seashore. |
” |