Blob Blame History Raw
<!-- Creator     : groff version 1.22.3 -->
<!-- CreationDate: Mon Sep  3 22:55:07 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta name="generator" content="groff -Thtml, see">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }


<p>ARCHIVE_READ_DATA(3) BSD Library Functions Manual

<p style="margin-top: 1em"><b>NAME</b></p>

<p style="margin-left:6%;"><b>archive_read_data
archive_read_data_block</b>, <b>archive_read_data_skip</b>,
<b>archive_read_data_into_fd</b> &mdash; functions for
reading streaming archives</p>

<p style="margin-top: 1em"><b>LIBRARY</b></p>

<p style="margin-left:6%;">Streaming Archive Library
(libarchive, -larchive)</p>

<p style="margin-top: 1em"><b>SYNOPSIS</b></p>

<p style="margin-left:6%;"><b>#include

<p style="margin-left:6%; margin-top: 1em"><i>la_ssize_t</i></p>

<p style="margin-left:12%;"><b>archive_read_data</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*buff</i>, <i>size_t&nbsp;len</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>

<i>const&nbsp;void&nbsp;**buff</i>, <i>size_t&nbsp;*len</i>,

<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>

<p style="margin-left:12%;"><b>archive_read_data_skip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>

<p style="margin-left:12%;"><b>archive_read_data_into_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,

<p style="margin-top: 1em"><b>DESCRIPTION <br>

<p style="margin-left:17%;">Read data associated with the
header just read. Internally, this is a convenience function
that calls <b>archive_read_data_block</b>() and fills any
gaps with nulls so that callers see a single continuous
stream of data.</p>


<p style="margin-left:17%;">Return the next available block
of data for this entry. Unlike <b>archive_read_data</b>(),
the <b>archive_read_data_block</b>() function avoids copying
data and allows you to correctly handle sparse files, as
supported by some archive formats. The library guarantees
that offsets will increase and that blocks will not overlap.
Note that the blocks returned from this function can be much
larger than the block size read from disk, due to
compression and internal buffer optimizations.</p>


<p style="margin-left:17%;">A convenience function that
repeatedly calls <b>archive_read_data_block</b>() to skip
all of the data for this archive entry. Note that this
function is invoked automatically by
<b>archive_read_next_header2</b>() if the previous entry was
not completely consumed.</p>


<p style="margin-left:17%;">A convenience function that
repeatedly calls <b>archive_read_data_block</b>() to copy
the entire entry to the provided file descriptor.</p>

<p style="margin-top: 1em"><b>RETURN VALUES</b></p>

<p style="margin-left:6%;">Most functions return zero on
success, non-zero on error. The possible return codes
include: <b>ARCHIVE_OK</b> (the operation succeeded),
<b>ARCHIVE_WARN</b> (the operation succeeded but a
non-critical error was encountered), <b>ARCHIVE_EOF</b>
(end-of-archive was encountered), <b>ARCHIVE_RETRY</b> (the
operation failed but can be retried), and
<b>ARCHIVE_FATAL</b> (there was a fatal error; the archive
should be closed immediately).</p>

<p style="margin-left:6%; margin-top: 1em"><b>archive_read_data</b>()
returns a count of bytes actually read or zero at the end of
the entry. On error, a value of <b>ARCHIVE_FATAL</b>,
<b>ARCHIVE_WARN</b>, or <b>ARCHIVE_RETRY</b> is

<p style="margin-top: 1em"><b>ERRORS</b></p>

<p style="margin-left:6%;">Detailed error codes and textual
descriptions are available from the <b>archive_errno</b>()
and <b>archive_error_string</b>() functions.</p>

<p style="margin-top: 1em"><b>SEE ALSO</b></p>

<p style="margin-left:6%;">tar(1), libarchive(3),
archive_read(3), archive_read_extract(3),
archive_read_filter(3), archive_read_format(3),
archive_read_header(3), archive_read_open(3),
archive_read_set_options(3), archive_util(3), tar(5)</p>

<p style="margin-left:6%; margin-top: 1em">BSD
February&nbsp;2, 2012 BSD</p>