ARCHIVE_READ_DATA(3)	 BSD Library Functions Manual	  ARCHIVE_READ_DATA(3)

1mNAME0m
     1marchive_read_data archive_read_data_block22m, 1marchive_read_data_skip22m,
     1marchive_read_data_into_fd 22m— functions for reading streaming archives

1mLIBRARY0m
     Streaming Archive Library (libarchive, -larchive)

1mSYNOPSIS0m
     1m#include <archive.h>0m

     4mla_ssize_t0m
     1marchive_read_data22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*buff24m, 4msize_t24m 4mlen24m);

     4mint0m
     1marchive_read_data_block22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mvoid24m 4m**buff24m, 4msize_t24m 4m*len24m,
	 4moff_t24m 4m*offset24m);

     4mint0m
     1marchive_read_data_skip22m(4mstruct24m 4marchive24m 4m*24m);

     4mint0m
     1marchive_read_data_into_fd22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4mfd24m);

1mDESCRIPTION0m
     1marchive_read_data22m()
	     Read data associated with the header just read.  Internally, this
	     is a convenience function that calls 1marchive_read_data_block22m()
	     and fills any gaps with nulls so that callers see a single con‐
	     tinuous stream of data.
     1marchive_read_data_block22m()
	     Return the next available block of data for this entry.  Unlike
	     1marchive_read_data22m(), the 1marchive_read_data_block22m() function
	     avoids copying data and allows you to correctly handle sparse
	     files, as supported by some archive formats.  The library guaran‐
	     tees 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.
     1marchive_read_data_skip22m()
	     A convenience function that repeatedly calls
	     1marchive_read_data_block22m() to skip all of the data for this ar‐
	     chive entry.  Note that this function is invoked automatically by
	     1marchive_read_next_header222m() if the previous entry was not com‐
	     pletely consumed.
     1marchive_read_data_into_fd22m()
	     A convenience function that repeatedly calls
	     1marchive_read_data_block22m() to copy the entire entry to the pro‐
	     vided file descriptor.

1mRETURN VALUES0m
     Most functions return zero on success, non-zero on error.	The possible
     return codes include: 1mARCHIVE_OK 22m(the operation succeeded), 1mARCHIVE_WARN0m
     (the operation succeeded but a non-critical error was encountered),
     1mARCHIVE_EOF 22m(end-of-archive was encountered), 1mARCHIVE_RETRY 22m(the opera‐
     tion failed but can be retried), and 1mARCHIVE_FATAL 22m(there was a fatal
     error; the archive should be closed immediately).

     1marchive_read_data22m() returns a count of bytes actually read or zero at the
     end of the entry.	On error, a value of 1mARCHIVE_FATAL22m, 1mARCHIVE_WARN22m, or
     1mARCHIVE_RETRY 22mis returned.

1mERRORS0m
     Detailed error codes and textual descriptions are available from the
     1marchive_errno22m() and 1marchive_error_string22m() functions.

1mSEE ALSO0m
     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)

BSD			       February 2, 2012 			   BSD
