|
Packit Service |
1d0348 |
.TH ARCHIVE_UTIL 3 "February 2, 2012" ""
|
|
Packit Service |
1d0348 |
.SH NAME
|
|
Packit Service |
1d0348 |
.ad l
|
|
Packit Service |
1d0348 |
\fB\%archive_clear_error\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_compression\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_compression_name\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_copy_error\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_errno\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_error_string\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_file_count\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_code\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_count\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_name\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_format\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_format_name\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_position\fP,
|
|
Packit Service |
1d0348 |
\fB\%archive_set_error\fP
|
|
Packit Service |
1d0348 |
\- libarchive utility functions
|
|
Packit Service |
1d0348 |
.SH LIBRARY
|
|
Packit Service |
1d0348 |
.ad l
|
|
Packit Service |
1d0348 |
Streaming Archive Library (libarchive, -larchive)
|
|
Packit Service |
1d0348 |
.SH SYNOPSIS
|
|
Packit Service |
1d0348 |
.ad l
|
|
Packit Service |
1d0348 |
\fB#include <archive.h>\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIvoid\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_clear_error\fP(\fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIint\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_compression\fP(\fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIconst char *\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_compression_name\fP(\fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIvoid\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_copy_error\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIint\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_errno\fP(\fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIconst char *\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_error_string\fP(\fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIint\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_file_count\fP(\fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIint\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_code\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIint\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_count\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIconst char *\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_name\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIint\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_format\fP(\fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIconst char *\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_format_name\fP(\fI\%struct\ archive\ *\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIint64_t\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_position\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fIvoid\fP
|
|
Packit Service |
1d0348 |
.br
|
|
Packit Service |
1d0348 |
\fB\%archive_set_error\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ error_code\fP, \fI\%const\ char\ *fmt\fP, \fI\%...\fP);
|
|
Packit Service |
1d0348 |
.SH DESCRIPTION
|
|
Packit Service |
1d0348 |
.ad l
|
|
Packit Service |
1d0348 |
These functions provide access to various information about the
|
|
Packit Service |
1d0348 |
Tn struct archive
|
|
Packit Service |
1d0348 |
object used in the
|
|
Packit Service |
1d0348 |
\fBlibarchive\fP(3)
|
|
Packit Service |
1d0348 |
library.
|
|
Packit Service |
1d0348 |
.RS 5
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_clear_error\fP()
|
|
Packit Service |
1d0348 |
Clears any error information left over from a previous call.
|
|
Packit Service |
1d0348 |
Not generally used in client code.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_compression\fP()
|
|
Packit Service |
1d0348 |
Synonym for
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_code(a,\fP(\fI\%0)\fP).
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_compression_name\fP()
|
|
Packit Service |
1d0348 |
Synonym for
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_name(a,\fP(\fI\%0)\fP).
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_copy_error\fP()
|
|
Packit Service |
1d0348 |
Copies error information from one archive to another.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_errno\fP()
|
|
Packit Service |
1d0348 |
Returns a numeric error code (see
|
|
Packit Service |
1d0348 |
\fBerrno\fP(2))
|
|
Packit Service |
1d0348 |
indicating the reason for the most recent error return.
|
|
Packit Service |
1d0348 |
Note that this can not be reliably used to detect whether an
|
|
Packit Service |
1d0348 |
error has occurred.
|
|
Packit Service |
1d0348 |
It should be used only after another libarchive function
|
|
Packit Service |
1d0348 |
has returned an error status.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_error_string\fP()
|
|
Packit Service |
1d0348 |
Returns a textual error message suitable for display.
|
|
Packit Service |
1d0348 |
The error message here is usually more specific than that
|
|
Packit Service |
1d0348 |
obtained from passing the result of
|
|
Packit Service |
1d0348 |
\fB\%archive_errno\fP()
|
|
Packit Service |
1d0348 |
to
|
|
Packit Service |
1d0348 |
\fBstrerror\fP(3).
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_file_count\fP()
|
|
Packit Service |
1d0348 |
Returns a count of the number of files processed by this archive object.
|
|
Packit Service |
1d0348 |
The count is incremented by calls to
|
|
Packit Service |
1d0348 |
\fBarchive_write_header\fP(3)
|
|
Packit Service |
1d0348 |
or
|
|
Packit Service |
1d0348 |
\fBarchive_read_next_header\fP(3).
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_code\fP()
|
|
Packit Service |
1d0348 |
Returns a numeric code identifying the indicated filter.
|
|
Packit Service |
1d0348 |
See
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_count\fP()
|
|
Packit Service |
1d0348 |
for details of the numbering.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_count\fP()
|
|
Packit Service |
1d0348 |
Returns the number of filters in the current pipeline.
|
|
Packit Service |
1d0348 |
For read archive handles, these filters are added automatically
|
|
Packit Service |
1d0348 |
by the automatic format detection.
|
|
Packit Service |
1d0348 |
For write archive handles, these filters are added by calls to the various
|
|
Packit Service |
1d0348 |
\fB\%archive_write_add_filter_XXX\fP()
|
|
Packit Service |
1d0348 |
functions.
|
|
Packit Service |
1d0348 |
Filters in the resulting pipeline are numbered so that filter 0
|
|
Packit Service |
1d0348 |
is the filter closest to the format handler.
|
|
Packit Service |
1d0348 |
As a convenience, functions that expect a filter number will
|
|
Packit Service |
1d0348 |
accept -1 as a synonym for the highest-numbered filter.
|
|
Packit Service |
1d0348 |
.PP
|
|
Packit Service |
1d0348 |
For example, when reading a uuencoded gzipped tar archive, there
|
|
Packit Service |
1d0348 |
are three filters:
|
|
Packit Service |
1d0348 |
filter 0 is the gunzip filter,
|
|
Packit Service |
1d0348 |
filter 1 is the uudecode filter,
|
|
Packit Service |
1d0348 |
and filter 2 is the pseudo-filter that wraps the archive read functions.
|
|
Packit Service |
1d0348 |
In this case, requesting
|
|
Packit Service |
1d0348 |
\fB\%archive_position(a,\fP(\fI\%-1)\fP)
|
|
Packit Service |
1d0348 |
would be a synonym for
|
|
Packit Service |
1d0348 |
\fB\%archive_position(a,\fP(\fI\%2)\fP)
|
|
Packit Service |
1d0348 |
which would return the number of bytes currently read from the archive, while
|
|
Packit Service |
1d0348 |
\fB\%archive_position(a,\fP(\fI\%1)\fP)
|
|
Packit Service |
1d0348 |
would return the number of bytes after uudecoding, and
|
|
Packit Service |
1d0348 |
\fB\%archive_position(a,\fP(\fI\%0)\fP)
|
|
Packit Service |
1d0348 |
would return the number of bytes after decompression.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_name\fP()
|
|
Packit Service |
1d0348 |
Returns a textual name identifying the indicated filter.
|
|
Packit Service |
1d0348 |
See
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_count\fP()
|
|
Packit Service |
1d0348 |
for details of the numbering.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_format\fP()
|
|
Packit Service |
1d0348 |
Returns a numeric code indicating the format of the current
|
|
Packit Service |
1d0348 |
archive entry.
|
|
Packit Service |
1d0348 |
This value is set by a successful call to
|
|
Packit Service |
1d0348 |
\fB\%archive_read_next_header\fP().
|
|
Packit Service |
1d0348 |
Note that it is common for this value to change from
|
|
Packit Service |
1d0348 |
entry to entry.
|
|
Packit Service |
1d0348 |
For example, a tar archive might have several entries that
|
|
Packit Service |
1d0348 |
utilize GNU tar extensions and several entries that do not.
|
|
Packit Service |
1d0348 |
These entries will have different format codes.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_format_name\fP()
|
|
Packit Service |
1d0348 |
A textual description of the format of the current entry.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_position\fP()
|
|
Packit Service |
1d0348 |
Returns the number of bytes read from or written to the indicated filter.
|
|
Packit Service |
1d0348 |
In particular,
|
|
Packit Service |
1d0348 |
\fB\%archive_position(a,\fP(\fI\%0)\fP)
|
|
Packit Service |
1d0348 |
returns the number of bytes read or written by the format handler, while
|
|
Packit Service |
1d0348 |
\fB\%archive_position(a,\fP(\fI\%-1)\fP)
|
|
Packit Service |
1d0348 |
returns the number of bytes read or written to the archive.
|
|
Packit Service |
1d0348 |
See
|
|
Packit Service |
1d0348 |
\fB\%archive_filter_count\fP()
|
|
Packit Service |
1d0348 |
for details of the numbering here.
|
|
Packit Service |
1d0348 |
.TP
|
|
Packit Service |
1d0348 |
\fB\%archive_set_error\fP()
|
|
Packit Service |
1d0348 |
Sets the numeric error code and error description that will be returned
|
|
Packit Service |
1d0348 |
by
|
|
Packit Service |
1d0348 |
\fB\%archive_errno\fP()
|
|
Packit Service |
1d0348 |
and
|
|
Packit Service |
1d0348 |
\fB\%archive_error_string\fP().
|
|
Packit Service |
1d0348 |
This function should be used within I/O callbacks to set system-specific
|
|
Packit Service |
1d0348 |
error codes and error descriptions.
|
|
Packit Service |
1d0348 |
This function accepts a printf-like format string and arguments.
|
|
Packit Service |
1d0348 |
However, you should be careful to use only the following printf
|
|
Packit Service |
1d0348 |
format specifiers:
|
|
Packit Service |
1d0348 |
``%c'',
|
|
Packit Service |
1d0348 |
``%d'',
|
|
Packit Service |
1d0348 |
``%jd'',
|
|
Packit Service |
1d0348 |
``%jo'',
|
|
Packit Service |
1d0348 |
``%ju'',
|
|
Packit Service |
1d0348 |
``%jx'',
|
|
Packit Service |
1d0348 |
``%ld'',
|
|
Packit Service |
1d0348 |
``%lo'',
|
|
Packit Service |
1d0348 |
``%lu'',
|
|
Packit Service |
1d0348 |
``%lx'',
|
|
Packit Service |
1d0348 |
``%o'',
|
|
Packit Service |
1d0348 |
``%u'',
|
|
Packit Service |
1d0348 |
``%s'',
|
|
Packit Service |
1d0348 |
``%x'',
|
|
Packit Service |
1d0348 |
``%%''.
|
|
Packit Service |
1d0348 |
Field-width specifiers and other printf features are
|
|
Packit Service |
1d0348 |
not uniformly supported and should not be used.
|
|
Packit Service |
1d0348 |
.RE
|
|
Packit Service |
1d0348 |
.SH SEE ALSO
|
|
Packit Service |
1d0348 |
.ad l
|
|
Packit Service |
1d0348 |
\fBarchive_read\fP(3),
|
|
Packit Service |
1d0348 |
\fBarchive_write\fP(3),
|
|
Packit Service |
1d0348 |
\fBlibarchive\fP(3),
|
|
Packit Service |
1d0348 |
\fBprintf\fP(3)
|
|
Packit Service |
1d0348 |
.SH HISTORY
|
|
Packit Service |
1d0348 |
.ad l
|
|
Packit Service |
1d0348 |
The
|
|
Packit Service |
1d0348 |
\fB\%libarchive\fP
|
|
Packit Service |
1d0348 |
library first appeared in
|
|
Packit Service |
1d0348 |
FreeBSD 5.3.
|
|
Packit Service |
1d0348 |
.SH AUTHORS
|
|
Packit Service |
1d0348 |
.ad l
|
|
Packit Service |
1d0348 |
-nosplit
|
|
Packit Service |
1d0348 |
The
|
|
Packit Service |
1d0348 |
\fB\%libarchive\fP
|
|
Packit Service |
1d0348 |
library was written by
|
|
Packit Service |
1d0348 |
Tim Kientzle \%<kientzle@acm.org.>
|