|
Packit Service |
1d0348 |
ARCHIVE_UTIL(3) manual page
|
|
Packit Service |
1d0348 |
== NAME ==
|
|
Packit Service |
1d0348 |
'''archive_clear_error''',
|
|
Packit Service |
1d0348 |
'''archive_compression''',
|
|
Packit Service |
1d0348 |
'''archive_compression_name''',
|
|
Packit Service |
1d0348 |
'''archive_copy_error''',
|
|
Packit Service |
1d0348 |
'''archive_errno''',
|
|
Packit Service |
1d0348 |
'''archive_error_string''',
|
|
Packit Service |
1d0348 |
'''archive_file_count''',
|
|
Packit Service |
1d0348 |
'''archive_filter_code''',
|
|
Packit Service |
1d0348 |
'''archive_filter_count''',
|
|
Packit Service |
1d0348 |
'''archive_filter_name''',
|
|
Packit Service |
1d0348 |
'''archive_format''',
|
|
Packit Service |
1d0348 |
'''archive_format_name''',
|
|
Packit Service |
1d0348 |
'''archive_position''',
|
|
Packit Service |
1d0348 |
'''archive_set_error'''
|
|
Packit Service |
1d0348 |
- libarchive utility functions
|
|
Packit Service |
1d0348 |
== LIBRARY ==
|
|
Packit Service |
1d0348 |
Streaming Archive Library (libarchive, -larchive)
|
|
Packit Service |
1d0348 |
== SYNOPSIS ==
|
|
Packit Service |
1d0348 |
'''<nowiki>#include <archive.h></nowiki>'''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''void''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_clear_error'''(''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''int''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_compression'''(''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''const char *''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_compression_name'''(''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''void''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_copy_error'''(''struct archive *'', ''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''int''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_errno'''(''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''const char *''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_error_string'''(''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''int''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_file_count'''(''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''int''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_filter_code'''(''struct archive *'', ''int'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''int''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_filter_count'''(''struct archive *'', ''int'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''const char *''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_filter_name'''(''struct archive *'', ''int'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''int''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_format'''(''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''const char *''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_format_name'''(''struct archive *'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''int64_t''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_position'''(''struct archive *'', ''int'');
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
''void''
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_set_error'''(''struct archive *'', ''int error_code'', ''const char *fmt'', ''...'');
|
|
Packit Service |
1d0348 |
== DESCRIPTION ==
|
|
Packit Service |
1d0348 |
These functions provide access to various information about the
|
|
Packit Service |
1d0348 |
'''struct archive'''
|
|
Packit Service |
1d0348 |
object used in the
|
|
Packit Service |
1d0348 |
[[ManPageibarchive3]]
|
|
Packit Service |
1d0348 |
library.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
'''archive_clear_error'''()
|
|
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 |
'''archive_compression'''()
|
|
Packit Service |
1d0348 |
Synonym for
|
|
Packit Service |
1d0348 |
'''archive_filter_code(a,'''(''0)'').
|
|
Packit Service |
1d0348 |
'''archive_compression_name'''()
|
|
Packit Service |
1d0348 |
Synonym for
|
|
Packit Service |
1d0348 |
'''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
|
|
Packit Service |
1d0348 |
[[errno(2)|http://www.freebsd.org/cgi/man.cgi?query=errno&sektion=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 |
'''archive_error_string'''()
|
|
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 |
'''archive_errno'''()
|
|
Packit Service |
1d0348 |
to
|
|
Packit Service |
1d0348 |
[[strerror(3)|http://www.freebsd.org/cgi/man.cgi?query=strerror&sektion=3]].
|
|
Packit Service |
1d0348 |
'''archive_file_count'''()
|
|
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 |
[[ManPagerchiveriteeader3]]
|
|
Packit Service |
1d0348 |
or
|
|
Packit Service |
1d0348 |
[[ManPagerchiveeadexteader3]].
|
|
Packit Service |
1d0348 |
'''archive_filter_code'''()
|
|
Packit Service |
1d0348 |
Returns a numeric code identifying the indicated filter.
|
|
Packit Service |
1d0348 |
See
|
|
Packit Service |
1d0348 |
'''archive_filter_count'''()
|
|
Packit Service |
1d0348 |
for details of the numbering.
|
|
Packit Service |
1d0348 |
'''archive_filter_count'''()
|
|
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 |
'''archive_write_add_filter_XXX'''()
|
|
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 |
|
|
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 |
'''archive_position(a,'''(''-1)'')
|
|
Packit Service |
1d0348 |
would be a synonym for
|
|
Packit Service |
1d0348 |
'''archive_position(a,'''(''2)'')
|
|
Packit Service |
1d0348 |
which would return the number of bytes currently read from the archive, while
|
|
Packit Service |
1d0348 |
'''archive_position(a,'''(''1)'')
|
|
Packit Service |
1d0348 |
would return the number of bytes after uudecoding, and
|
|
Packit Service |
1d0348 |
'''archive_position(a,'''(''0)'')
|
|
Packit Service |
1d0348 |
would return the number of bytes after decompression.
|
|
Packit Service |
1d0348 |
'''archive_filter_name'''()
|
|
Packit Service |
1d0348 |
Returns a textual name identifying the indicated filter.
|
|
Packit Service |
1d0348 |
See
|
|
Packit Service |
1d0348 |
'''archive_filter_count'''()
|
|
Packit Service |
1d0348 |
for details of the numbering.
|
|
Packit Service |
1d0348 |
'''archive_format'''()
|
|
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 |
'''archive_read_next_header'''().
|
|
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 |
'''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 filter.
|
|
Packit Service |
1d0348 |
In particular,
|
|
Packit Service |
1d0348 |
'''archive_position(a,'''(''0)'')
|
|
Packit Service |
1d0348 |
returns the number of bytes read or written by the format handler, while
|
|
Packit Service |
1d0348 |
'''archive_position(a,'''(''-1)'')
|
|
Packit Service |
1d0348 |
returns the number of bytes read or written to the archive.
|
|
Packit Service |
1d0348 |
See
|
|
Packit Service |
1d0348 |
'''archive_filter_count'''()
|
|
Packit Service |
1d0348 |
for details of the numbering here.
|
|
Packit Service |
1d0348 |
'''archive_set_error'''()
|
|
Packit Service |
1d0348 |
Sets the numeric error code and error description that will be returned
|
|
Packit Service |
1d0348 |
by
|
|
Packit Service |
1d0348 |
'''archive_errno'''()
|
|
Packit Service |
1d0348 |
and
|
|
Packit Service |
1d0348 |
'''archive_error_string'''().
|
|
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 |
|
|
Packit Service |
1d0348 |
== SEE ALSO ==
|
|
Packit Service |
1d0348 |
[[ManPagerchiveead3]],
|
|
Packit Service |
1d0348 |
[[ManPagerchiverite3]],
|
|
Packit Service |
1d0348 |
[[ManPageibarchive3]],
|
|
Packit Service |
1d0348 |
[[printf(3)|http://www.freebsd.org/cgi/man.cgi?query=printf&sektion=3]]
|
|
Packit Service |
1d0348 |
== HISTORY ==
|
|
Packit Service |
1d0348 |
The
|
|
Packit Service |
1d0348 |
'''libarchive'''
|
|
Packit Service |
1d0348 |
library first appeared in
|
|
Packit Service |
1d0348 |
FreeBSD 5.3.
|
|
Packit Service |
1d0348 |
== AUTHORS ==
|
|
Packit Service |
1d0348 |
The
|
|
Packit Service |
1d0348 |
'''libarchive'''
|
|
Packit Service |
1d0348 |
library was written by
|
|
Packit Service |
1d0348 |
Tim Kientzle <kientzle@acm.org.>
|