Blame doc/text/archive_read_extract.3.txt

Packit 08bd4c
ARCHIVE_READ_EXTRACT(3)  BSD Library Functions Manual  ARCHIVE_READ_EXTRACT(3)
Packit 08bd4c
Packit 08bd4c
NAME
Packit 08bd4c
     archive_read_extract, archive_read_extract2,
Packit 08bd4c
     archive_read_extract_set_progress_callback — functions for reading
Packit 08bd4c
     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
     int
Packit 08bd4c
     archive_read_extract(struct archive *, struct archive_entry *,
Packit 08bd4c
	 int flags);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_read_extract2(struct archive *src, struct archive_entry *,
Packit 08bd4c
	 struct archive *dest);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_read_extract_set_progress_callback(struct archive *,
Packit 08bd4c
	 void (*func)(void *), void *user_data);
Packit 08bd4c
Packit 08bd4c
DESCRIPTION
Packit 08bd4c
     archive_read_extract(), archive_read_extract_set_skip_file()
Packit 08bd4c
	     A convenience function that wraps the corresponding
Packit 08bd4c
	     archive_write_disk(3) interfaces.	The first call to
Packit 08bd4c
	     archive_read_extract() creates a restore object using
Packit 08bd4c
	     archive_write_disk_new(3) and
Packit 08bd4c
	     archive_write_disk_set_standard_lookup(3), then transparently
Packit 08bd4c
	     invokes archive_write_disk_set_options(3),
Packit 08bd4c
	     archive_write_header(3), archive_write_data(3), and
Packit 08bd4c
	     archive_write_finish_entry(3) to create the entry on disk and
Packit 08bd4c
	     copy data into it.  The flags argument is passed unmodified to
Packit 08bd4c
	     archive_write_disk_set_options(3).
Packit 08bd4c
     archive_read_extract2()
Packit 08bd4c
	     This is another version of archive_read_extract() that allows you
Packit 08bd4c
	     to provide your own restore object.  In particular, this allows
Packit 08bd4c
	     you to override the standard lookup functions using
Packit 08bd4c
	     archive_write_disk_set_group_lookup(3), and
Packit 08bd4c
	     archive_write_disk_set_user_lookup(3).  Note that
Packit 08bd4c
	     archive_read_extract2() does not accept a flags argument; you
Packit 08bd4c
	     should use archive_write_disk_set_options() to set the restore
Packit 08bd4c
	     options yourself.
Packit 08bd4c
     archive_read_extract_set_progress_callback()
Packit 08bd4c
	     Sets a pointer to a user-defined callback that can be used for
Packit 08bd4c
	     updating progress displays during extraction.  The progress func‐
Packit 08bd4c
	     tion will be invoked during the extraction of large regular
Packit 08bd4c
	     files.  The progress function will be invoked with the pointer
Packit 08bd4c
	     provided to this call.  Generally, the data pointed to should
Packit 08bd4c
	     include a reference to the archive object and the archive_entry
Packit 08bd4c
	     object so that various statistics can be retrieved for the
Packit 08bd4c
	     progress display.
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
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_data(3),
Packit 08bd4c
     archive_read_filter(3), archive_read_format(3), archive_read_open(3),
Packit 08bd4c
     archive_read_set_options(3), archive_util(3), tar(5)
Packit 08bd4c
Packit 08bd4c
BSD			       February 2, 2012 			   BSD