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