Blame doc/text/archive_read_data.3.txt

Packit 08bd4c
ARCHIVE_READ_DATA(3)	 BSD Library Functions Manual	  ARCHIVE_READ_DATA(3)
Packit 08bd4c
Packit 08bd4c
NAME
Packit 08bd4c
     archive_read_data archive_read_data_block, archive_read_data_skip,
Packit 08bd4c
     archive_read_data_into_fd — functions for reading streaming archives
Packit 08bd4c
Packit 08bd4c
LIBRARY
Packit 08bd4c
     Streaming Archive Library (libarchive, -larchive)
Packit 08bd4c
Packit 08bd4c
SYNOPSIS
Packit 08bd4c
     #include <archive.h>
Packit 08bd4c
Packit 08bd4c
     la_ssize_t
Packit 08bd4c
     archive_read_data(struct archive *, void *buff, size_t len);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_read_data_block(struct archive *, const void **buff, size_t *len,
Packit 08bd4c
	 off_t *offset);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_read_data_skip(struct archive *);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_read_data_into_fd(struct archive *, int fd);
Packit 08bd4c
Packit 08bd4c
DESCRIPTION
Packit 08bd4c
     archive_read_data()
Packit 08bd4c
	     Read data associated with the header just read.  Internally, this
Packit 08bd4c
	     is a convenience function that calls archive_read_data_block()
Packit 08bd4c
	     and fills any gaps with nulls so that callers see a single con‐
Packit 08bd4c
	     tinuous stream of data.
Packit 08bd4c
     archive_read_data_block()
Packit 08bd4c
	     Return the next available block of data for this entry.  Unlike
Packit 08bd4c
	     archive_read_data(), the archive_read_data_block() function
Packit 08bd4c
	     avoids copying data and allows you to correctly handle sparse
Packit 08bd4c
	     files, as supported by some archive formats.  The library guaran‐
Packit 08bd4c
	     tees that offsets will increase and that blocks will not overlap.
Packit 08bd4c
	     Note that the blocks returned from this function can be much
Packit 08bd4c
	     larger than the block size read from disk, due to compression and
Packit 08bd4c
	     internal buffer optimizations.
Packit 08bd4c
     archive_read_data_skip()
Packit 08bd4c
	     A convenience function that repeatedly calls
Packit 08bd4c
	     archive_read_data_block() to skip all of the data for this ar‐
Packit 08bd4c
	     chive entry.  Note that this function is invoked automatically by
Packit 08bd4c
	     archive_read_next_header2() if the previous entry was not com‐
Packit 08bd4c
	     pletely consumed.
Packit 08bd4c
     archive_read_data_into_fd()
Packit 08bd4c
	     A convenience function that repeatedly calls
Packit 08bd4c
	     archive_read_data_block() to copy the entire entry to the pro‐
Packit 08bd4c
	     vided file descriptor.
Packit 08bd4c
Packit 08bd4c
RETURN VALUES
Packit 08bd4c
     Most functions return zero on success, non-zero on error.	The possible
Packit 08bd4c
     return codes include: ARCHIVE_OK (the operation succeeded), ARCHIVE_WARN
Packit 08bd4c
     (the operation succeeded but a non-critical error was encountered),
Packit 08bd4c
     ARCHIVE_EOF (end-of-archive was encountered), ARCHIVE_RETRY (the opera‐
Packit 08bd4c
     tion failed but can be retried), and ARCHIVE_FATAL (there was a fatal
Packit 08bd4c
     error; the archive should be closed immediately).
Packit 08bd4c
Packit 08bd4c
     archive_read_data() returns a count of bytes actually read or zero at the
Packit 08bd4c
     end of the entry.	On error, a value of ARCHIVE_FATAL, ARCHIVE_WARN, or
Packit 08bd4c
     ARCHIVE_RETRY is returned.
Packit 08bd4c
Packit 08bd4c
ERRORS
Packit 08bd4c
     Detailed error codes and textual descriptions are available from the
Packit 08bd4c
     archive_errno() and archive_error_string() functions.
Packit 08bd4c
Packit 08bd4c
SEE ALSO
Packit 08bd4c
     tar(1), libarchive(3), archive_read(3), archive_read_extract(3),
Packit 08bd4c
     archive_read_filter(3), archive_read_format(3), archive_read_header(3),
Packit 08bd4c
     archive_read_open(3), archive_read_set_options(3), archive_util(3),
Packit 08bd4c
     tar(5)
Packit 08bd4c
Packit 08bd4c
BSD			       February 2, 2012 			   BSD