1<!-- Creator : groff version 1.22.4 --> 2<!-- CreationDate: Sun Aug 22 23:03:25 2021 --> 3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 4"http://www.w3.org/TR/html4/loose.dtd"> 5<html> 6<head> 7<meta name="generator" content="groff -Thtml, see www.gnu.org"> 8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 9<meta name="Content-Style" content="text/css"> 10<style type="text/css"> 11 p { margin-top: 0; margin-bottom: 0; vertical-align: top } 12 pre { margin-top: 0; margin-bottom: 0; vertical-align: top } 13 table { margin-top: 0; margin-bottom: 0; vertical-align: top } 14 h1 { text-align: center } 15</style> 16<title></title> 17</head> 18<body> 19 20<hr> 21 22 23<p>ARCHIVE_READ_DATA(3) BSD Library Functions Manual 24ARCHIVE_READ_DATA(3)</p> 25 26<p style="margin-top: 1em"><b>NAME</b></p> 27 28<p style="margin-left:6%;"><b>archive_read_data</b>, 29<b>archive_read_data_block</b>, 30<b>archive_read_data_skip</b>, 31<b>archive_read_data_into_fd</b> — functions for 32reading streaming archives</p> 33 34<p style="margin-top: 1em"><b>LIBRARY</b></p> 35 36<p style="margin-left:6%;">Streaming Archive Library 37(libarchive, -larchive)</p> 38 39<p style="margin-top: 1em"><b>SYNOPSIS</b></p> 40 41<p style="margin-left:6%;"><b>#include 42<archive.h></b></p> 43 44 45<p style="margin-left:6%; margin-top: 1em"><i>la_ssize_t</i></p> 46 47 48<p style="margin-left:12%;"><b>archive_read_data</b>(<i>struct archive *</i>, 49<i>void *buff</i>, <i>size_t len</i>);</p> 50 51<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> 52 53 54<p><b>archive_read_data_block</b>(<i>struct archive *</i>, 55<i>const void **buff</i>, <i>size_t *len</i>, 56<i>off_t *offset</i>);</p> 57 58<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> 59 60 61<p style="margin-left:12%;"><b>archive_read_data_skip</b>(<i>struct archive *</i>);</p> 62 63<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> 64 65 66<p style="margin-left:12%;"><b>archive_read_data_into_fd</b>(<i>struct archive *</i>, 67<i>int fd</i>);</p> 68 69<p style="margin-top: 1em"><b>DESCRIPTION <br> 70archive_read_data</b>()</p> 71 72<p style="margin-left:17%;">Read data associated with the 73header just read. Internally, this is a convenience function 74that calls <b>archive_read_data_block</b>() and fills any 75gaps with nulls so that callers see a single continuous 76stream of data.</p> 77 78<p><b>archive_read_data_block</b>()</p> 79 80<p style="margin-left:17%;">Return the next available block 81of data for this entry. Unlike <b>archive_read_data</b>(), 82the <b>archive_read_data_block</b>() function avoids copying 83data and allows you to correctly handle sparse files, as 84supported by some archive formats. The library guarantees 85that offsets will increase and that blocks will not overlap. 86Note that the blocks returned from this function can be much 87larger than the block size read from disk, due to 88compression and internal buffer optimizations.</p> 89 90<p><b>archive_read_data_skip</b>()</p> 91 92<p style="margin-left:17%;">A convenience function that 93repeatedly calls <b>archive_read_data_block</b>() to skip 94all of the data for this archive entry. Note that this 95function is invoked automatically by 96<b>archive_read_next_header2</b>() if the previous entry was 97not completely consumed.</p> 98 99<p><b>archive_read_data_into_fd</b>()</p> 100 101<p style="margin-left:17%;">A convenience function that 102repeatedly calls <b>archive_read_data_block</b>() to copy 103the entire entry to the provided file descriptor.</p> 104 105<p style="margin-top: 1em"><b>RETURN VALUES</b></p> 106 107<p style="margin-left:6%;">Most functions return zero on 108success, non-zero on error. The possible return codes 109include: <b>ARCHIVE_OK</b> (the operation succeeded), 110<b>ARCHIVE_WARN</b> (the operation succeeded but a 111non-critical error was encountered), <b>ARCHIVE_EOF</b> 112(end-of-archive was encountered), <b>ARCHIVE_RETRY</b> (the 113operation failed but can be retried), and 114<b>ARCHIVE_FATAL</b> (there was a fatal error; the archive 115should be closed immediately).</p> 116 117 118<p style="margin-left:6%; margin-top: 1em"><b>archive_read_data</b>() 119returns a count of bytes actually read or zero at the end of 120the entry. On error, a value of <b>ARCHIVE_FATAL</b>, 121<b>ARCHIVE_WARN</b>, or <b>ARCHIVE_RETRY</b> is 122returned.</p> 123 124<p style="margin-top: 1em"><b>ERRORS</b></p> 125 126<p style="margin-left:6%;">Detailed error codes and textual 127descriptions are available from the <b>archive_errno</b>() 128and <b>archive_error_string</b>() functions.</p> 129 130<p style="margin-top: 1em"><b>SEE ALSO</b></p> 131 132<p style="margin-left:6%;">tar(1), archive_read(3), 133archive_read_extract(3), archive_read_filter(3), 134archive_read_format(3), archive_read_header(3), 135archive_read_open(3), archive_read_set_options(3), 136archive_util(3), libarchive(3), tar(5)</p> 137 138<p style="margin-left:6%; margin-top: 1em">BSD 139February 2, 2012 BSD</p> 140<hr> 141</body> 142</html> 143