Blame doc/man/archive_read_data.3

Packit Service 1d0348
.TH ARCHIVE_READ_DATA 3 "February 2, 2012" ""
Packit Service 1d0348
.SH NAME
Packit Service 1d0348
.ad l
Packit Service 1d0348
\fB\%archive_read_data\fP
Packit Service 1d0348
\fB\%archive_read_data_block\fP,
Packit Service 1d0348
\fB\%archive_read_data_skip\fP,
Packit Service 1d0348
\fB\%archive_read_data_into_fd\fP
Packit Service 1d0348
\- functions for reading streaming archives
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
\fIla_ssize_t\fP
Packit Service 1d0348
.br
Packit Service 1d0348
\fB\%archive_read_data\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *buff\fP, \fI\%size_t\ len\fP);
Packit Service 1d0348
.br
Packit Service 1d0348
\fIint\fP
Packit Service 1d0348
.br
Packit Service 1d0348
\fB\%archive_read_data_block\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ **buff\fP, \fI\%size_t\ *len\fP, \fI\%off_t\ *offset\fP);
Packit Service 1d0348
.br
Packit Service 1d0348
\fIint\fP
Packit Service 1d0348
.br
Packit Service 1d0348
\fB\%archive_read_data_skip\fP(\fI\%struct\ archive\ *\fP);
Packit Service 1d0348
.br
Packit Service 1d0348
\fIint\fP
Packit Service 1d0348
.br
Packit Service 1d0348
\fB\%archive_read_data_into_fd\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ fd\fP);
Packit Service 1d0348
.SH DESCRIPTION
Packit Service 1d0348
.ad l
Packit Service 1d0348
.RS 5
Packit Service 1d0348
.TP
Packit Service 1d0348
\fB\%archive_read_data\fP()
Packit Service 1d0348
Read data associated with the header just read.
Packit Service 1d0348
Internally, this is a convenience function that calls
Packit Service 1d0348
\fB\%archive_read_data_block\fP()
Packit Service 1d0348
and fills any gaps with nulls so that callers see a single
Packit Service 1d0348
continuous stream of data.
Packit Service 1d0348
.TP
Packit Service 1d0348
\fB\%archive_read_data_block\fP()
Packit Service 1d0348
Return the next available block of data for this entry.
Packit Service 1d0348
Unlike
Packit Service 1d0348
\fB\%archive_read_data\fP(),
Packit Service 1d0348
the
Packit Service 1d0348
\fB\%archive_read_data_block\fP()
Packit Service 1d0348
function avoids copying data and allows you to correctly handle
Packit Service 1d0348
sparse files, as supported by some archive formats.
Packit Service 1d0348
The library guarantees that offsets will increase and that blocks
Packit Service 1d0348
will not overlap.
Packit Service 1d0348
Note that the blocks returned from this function can be much larger
Packit Service 1d0348
than the block size read from disk, due to compression
Packit Service 1d0348
and internal buffer optimizations.
Packit Service 1d0348
.TP
Packit Service 1d0348
\fB\%archive_read_data_skip\fP()
Packit Service 1d0348
A convenience function that repeatedly calls
Packit Service 1d0348
\fB\%archive_read_data_block\fP()
Packit Service 1d0348
to skip all of the data for this archive entry.
Packit Service 1d0348
Note that this function is invoked automatically by
Packit Service 1d0348
\fB\%archive_read_next_header2\fP()
Packit Service 1d0348
if the previous entry was not completely consumed.
Packit Service 1d0348
.TP
Packit Service 1d0348
\fB\%archive_read_data_into_fd\fP()
Packit Service 1d0348
A convenience function that repeatedly calls
Packit Service 1d0348
\fB\%archive_read_data_block\fP()
Packit Service 1d0348
to copy the entire entry to the provided file descriptor.
Packit Service 1d0348
.RE
Packit Service 1d0348
.SH RETURN VALUES
Packit Service 1d0348
.ad l
Packit Service 1d0348
Most functions return zero on success, non-zero on error.
Packit Service 1d0348
The possible return codes include:
Packit Service 1d0348
\fBARCHIVE_OK\fP
Packit Service 1d0348
(the operation succeeded),
Packit Service 1d0348
\fBARCHIVE_WARN\fP
Packit Service 1d0348
(the operation succeeded but a non-critical error was encountered),
Packit Service 1d0348
\fBARCHIVE_EOF\fP
Packit Service 1d0348
(end-of-archive was encountered),
Packit Service 1d0348
\fBARCHIVE_RETRY\fP
Packit Service 1d0348
(the operation failed but can be retried),
Packit Service 1d0348
and
Packit Service 1d0348
\fBARCHIVE_FATAL\fP
Packit Service 1d0348
(there was a fatal error; the archive should be closed immediately).
Packit Service 1d0348
.PP
Packit Service 1d0348
\fB\%archive_read_data\fP()
Packit Service 1d0348
returns a count of bytes actually read or zero at the end of the entry.
Packit Service 1d0348
On error, a value of
Packit Service 1d0348
\fBARCHIVE_FATAL\fP,
Packit Service 1d0348
\fBARCHIVE_WARN\fP,
Packit Service 1d0348
or
Packit Service 1d0348
\fBARCHIVE_RETRY\fP
Packit Service 1d0348
is returned.
Packit Service 1d0348
.SH ERRORS
Packit Service 1d0348
.ad l
Packit Service 1d0348
Detailed error codes and textual descriptions are available from the
Packit Service 1d0348
\fB\%archive_errno\fP()
Packit Service 1d0348
and
Packit Service 1d0348
\fB\%archive_error_string\fP()
Packit Service 1d0348
functions.
Packit Service 1d0348
.SH SEE ALSO
Packit Service 1d0348
.ad l
Packit Service 1d0348
\fBtar\fP(1),
Packit Service 1d0348
\fBlibarchive\fP(3),
Packit Service 1d0348
\fBarchive_read\fP(3),
Packit Service 1d0348
\fBarchive_read_extract\fP(3),
Packit Service 1d0348
\fBarchive_read_filter\fP(3),
Packit Service 1d0348
\fBarchive_read_format\fP(3),
Packit Service 1d0348
\fBarchive_read_header\fP(3),
Packit Service 1d0348
\fBarchive_read_open\fP(3),
Packit Service 1d0348
\fBarchive_read_set_options\fP(3),
Packit Service 1d0348
\fBarchive_util\fP(3),
Packit Service 1d0348
\fBtar\fP(5)