1ARCHIVE_READ_EXTRACT(3)  BSD Library Functions Manual  ARCHIVE_READ_EXTRACT(3)
2

NAME

4     archive_read_extract, archive_read_extract2,
5     archive_read_extract_set_progress_callback — functions for reading
6     streaming archives
7

LIBRARY

9     Streaming Archive Library (libarchive, -larchive)
10

SYNOPSIS

12     #include <archive.h>
13
14     int
15     archive_read_extract(struct archive *, struct archive_entry *,
16         int flags);
17
18     int
19     archive_read_extract2(struct archive *src, struct archive_entry *,
20         struct archive *dest);
21
22     void
23     archive_read_extract_set_progress_callback(struct archive *,
24         void (*func)(void *), void *user_data);
25

DESCRIPTION

27     archive_read_extract(), archive_read_extract_set_skip_file()
28             A convenience function that wraps the corresponding
29             archive_write_disk(3) interfaces.  The first call to
30             archive_read_extract() creates a restore object using
31             archive_write_disk_new(3) and
32             archive_write_disk_set_standard_lookup(3), then transparently
33             invokes archive_write_disk_set_options(3),
34             archive_write_header(3), archive_write_data(3), and
35             archive_write_finish_entry(3) to create the entry on disk and
36             copy data into it.  The flags argument is passed unmodified to
37             archive_write_disk_set_options(3).
38     archive_read_extract2()
39             This is another version of archive_read_extract() that allows you
40             to provide your own restore object.  In particular, this allows
41             you to override the standard lookup functions using
42             archive_write_disk_set_group_lookup(3), and
43             archive_write_disk_set_user_lookup(3).  Note that
44             archive_read_extract2() does not accept a flags argument; you
45             should use archive_write_disk_set_options() to set the restore
46             options yourself.
47     archive_read_extract_set_progress_callback()
48             Sets a pointer to a user-defined callback that can be used for
49             updating progress displays during extraction.  The progress func‐
50             tion will be invoked during the extraction of large regular
51             files.  The progress function will be invoked with the pointer
52             provided to this call.  Generally, the data pointed to should
53             include a reference to the archive object and the archive_entry
54             object so that various statistics can be retrieved for the
55             progress display.
56

RETURN VALUES

58     Most functions return zero on success, non-zero on error.  The possible
59     return codes include: ARCHIVE_OK (the operation succeeded), ARCHIVE_WARN
60     (the operation succeeded but a non-critical error was encountered),
61     ARCHIVE_EOF (end-of-archive was encountered), ARCHIVE_RETRY (the opera‐
62     tion failed but can be retried), and ARCHIVE_FATAL (there was a fatal
63     error; the archive should be closed immediately).
64

ERRORS

66     Detailed error codes and textual descriptions are available from the
67     archive_errno() and archive_error_string() functions.
68

SEE ALSO

70     tar(1), libarchive(3), archive_read(3), archive_read_data(3),
71     archive_read_filter(3), archive_read_format(3), archive_read_open(3),
72     archive_read_set_options(3), archive_util(3), tar(5)
73
74BSD                            February 2, 2012                            BSD
Impressum