Blame doc/wiki/ManPageArchiveReadData3.wiki

Packit Service 1d0348
ARCHIVE_READ_DATA(3) manual page 
Packit Service 1d0348
== NAME == 
Packit Service 1d0348
'''archive_read_data''' 
Packit Service 1d0348
'''archive_read_data_block''', 
Packit Service 1d0348
'''archive_read_data_skip''', 
Packit Service 1d0348
'''archive_read_data_into_fd''' 
Packit Service 1d0348
- functions for reading streaming archives 
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
''la_ssize_t'' 
Packit Service 1d0348

Packit Service 1d0348
'''archive_read_data'''(''struct archive *'', ''void *buff'', ''size_t len''); 
Packit Service 1d0348

Packit Service 1d0348
''int'' 
Packit Service 1d0348

Packit Service 1d0348
'''archive_read_data_block'''(''struct archive *'', ''const void **buff'', ''size_t *len'', ''off_t *offset''); 
Packit Service 1d0348

Packit Service 1d0348
''int'' 
Packit Service 1d0348

Packit Service 1d0348
'''archive_read_data_skip'''(''struct archive *''); 
Packit Service 1d0348

Packit Service 1d0348
''int'' 
Packit Service 1d0348

Packit Service 1d0348
'''archive_read_data_into_fd'''(''struct archive *'', ''int fd''); 
Packit Service 1d0348
== DESCRIPTION == 
Packit Service 1d0348
Packit Service 1d0348
'''archive_read_data'''()
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
'''archive_read_data_block'''() 
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
'''archive_read_data_block'''()
Packit Service 1d0348
Return the next available block of data for this entry. 
Packit Service 1d0348
Unlike 
Packit Service 1d0348
'''archive_read_data'''(), 
Packit Service 1d0348
the 
Packit Service 1d0348
'''archive_read_data_block'''() 
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
'''archive_read_data_skip'''()
Packit Service 1d0348
A convenience function that repeatedly calls 
Packit Service 1d0348
'''archive_read_data_block'''() 
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
'''archive_read_next_header2'''() 
Packit Service 1d0348
if the previous entry was not completely consumed. 
Packit Service 1d0348
'''archive_read_data_into_fd'''()
Packit Service 1d0348
A convenience function that repeatedly calls 
Packit Service 1d0348
'''archive_read_data_block'''() 
Packit Service 1d0348
to copy the entire entry to the provided file descriptor. 
Packit Service 1d0348
 
Packit Service 1d0348
== RETURN VALUES == 
Packit Service 1d0348
Most functions return zero on success, non-zero on error. 
Packit Service 1d0348
The possible return codes include: 
Packit Service 1d0348
'''ARCHIVE_OK''' 
Packit Service 1d0348
(the operation succeeded), 
Packit Service 1d0348
'''ARCHIVE_WARN''' 
Packit Service 1d0348
(the operation succeeded but a non-critical error was encountered), 
Packit Service 1d0348
'''ARCHIVE_EOF''' 
Packit Service 1d0348
(end-of-archive was encountered), 
Packit Service 1d0348
'''ARCHIVE_RETRY''' 
Packit Service 1d0348
(the operation failed but can be retried), 
Packit Service 1d0348
and 
Packit Service 1d0348
'''ARCHIVE_FATAL''' 
Packit Service 1d0348
(there was a fatal error; the archive should be closed immediately). 
Packit Service 1d0348
Packit Service 1d0348
'''archive_read_data'''() 
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
'''ARCHIVE_FATAL''', 
Packit Service 1d0348
'''ARCHIVE_WARN''', 
Packit Service 1d0348
or 
Packit Service 1d0348
'''ARCHIVE_RETRY''' 
Packit Service 1d0348
is returned. 
Packit Service 1d0348
== ERRORS == 
Packit Service 1d0348
Detailed error codes and textual descriptions are available from the 
Packit Service 1d0348
'''archive_errno'''() 
Packit Service 1d0348
and 
Packit Service 1d0348
'''archive_error_string'''() 
Packit Service 1d0348
functions. 
Packit Service 1d0348
== SEE ALSO == 
Packit Service 1d0348
[[ManPageBsdtar1]], 
Packit Service 1d0348
[[ManPageibarchive3]], 
Packit Service 1d0348
[[ManPagerchiveead3]], 
Packit Service 1d0348
[[ManPagerchiveeadxtract3]], 
Packit Service 1d0348
[[ManPagerchiveeadilter3]], 
Packit Service 1d0348
[[ManPagerchiveeadormat3]], 
Packit Service 1d0348
[[ManPagerchiveeadeader3]], 
Packit Service 1d0348
[[ManPagerchiveeadpen3]], 
Packit Service 1d0348
[[ManPagerchiveeadetptions3]], 
Packit Service 1d0348
[[ManPagerchivetil3]], 
Packit Service 1d0348
[[ManPageTar5]]