1<!-- Creator : groff version 1.22.4 --> 2<!-- CreationDate: Sun Aug 22 23:03:25 2021 --> 3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 4"http://www.w3.org/TR/html4/loose.dtd"> 5<html> 6<head> 7<meta name="generator" content="groff -Thtml, see www.gnu.org"> 8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 9<meta name="Content-Style" content="text/css"> 10<style type="text/css"> 11 p { margin-top: 0; margin-bottom: 0; vertical-align: top } 12 pre { margin-top: 0; margin-bottom: 0; vertical-align: top } 13 table { margin-top: 0; margin-bottom: 0; vertical-align: top } 14 h1 { text-align: center } 15</style> 16<title></title> 17</head> 18<body> 19 20<hr> 21 22 23<p>ARCHIVE_READ_EXTRACT(3) BSD Library Functions Manual 24ARCHIVE_READ_EXTRACT(3)</p> 25 26<p style="margin-top: 1em"><b>NAME</b></p> 27 28<p style="margin-left:6%;"><b>archive_read_extract</b>, 29<b>archive_read_extract2</b>, 30<b>archive_read_extract_set_progress_callback</b> — 31functions for reading streaming archives</p> 32 33<p style="margin-top: 1em"><b>LIBRARY</b></p> 34 35<p style="margin-left:6%;">Streaming Archive Library 36(libarchive, -larchive)</p> 37 38<p style="margin-top: 1em"><b>SYNOPSIS</b></p> 39 40<p style="margin-left:6%;"><b>#include 41<archive.h></b></p> 42 43<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> 44 45 46<p><b>archive_read_extract</b>(<i>struct archive *</i>, 47<i>struct archive_entry *</i>, 48<i>int flags</i>);</p> 49 50<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> 51 52 53<p><b>archive_read_extract2</b>(<i>struct archive *src</i>, 54<i>struct archive_entry *</i>, 55<i>struct archive *dest</i>);</p> 56 57<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 58 59 60<p><b>archive_read_extract_set_progress_callback</b>(<i>struct archive *</i>, 61<i>void (*func)(void *)</i>, 62<i>void *user_data</i>);</p> 63 64<p style="margin-top: 1em"><b>DESCRIPTION <br> 65archive_read_extract</b>(), 66<b>archive_read_extract_set_skip_file</b>()</p> 67 68<p style="margin-left:17%;">A convenience function that 69wraps the corresponding archive_write_disk(3) interfaces. 70The first call to <b>archive_read_extract</b>() creates a 71restore object using archive_write_disk_new(3) and 72archive_write_disk_set_standard_lookup(3), then 73transparently invokes archive_write_disk_set_options(3), 74archive_write_header(3), archive_write_data(3), and 75archive_write_finish_entry(3) to create the entry on disk 76and copy data into it. The <i>flags</i> argument is passed 77unmodified to archive_write_disk_set_options(3).</p> 78 79<p><b>archive_read_extract2</b>()</p> 80 81<p style="margin-left:17%;">This is another version of 82<b>archive_read_extract</b>() that allows you to provide 83your own restore object. In particular, this allows you to 84override the standard lookup functions using 85archive_write_disk_set_group_lookup(3), and 86archive_write_disk_set_user_lookup(3). Note that 87<b>archive_read_extract2</b>() does not accept a 88<i>flags</i> argument; you should use 89<b>archive_write_disk_set_options</b>() to set the restore 90options yourself.</p> 91 92<p><b>archive_read_extract_set_progress_callback</b>()</p> 93 94<p style="margin-left:17%;">Sets a pointer to a 95user-defined callback that can be used for updating progress 96displays during extraction. The progress function will be 97invoked during the extraction of large regular files. The 98progress function will be invoked with the pointer provided 99to this call. Generally, the data pointed to should include 100a reference to the archive object and the archive_entry 101object so that various statistics can be retrieved for the 102progress display.</p> 103 104<p style="margin-top: 1em"><b>RETURN VALUES</b></p> 105 106<p style="margin-left:6%;">Most functions return zero on 107success, non-zero on error. The possible return codes 108include: <b>ARCHIVE_OK</b> (the operation succeeded), 109<b>ARCHIVE_WARN</b> (the operation succeeded but a 110non-critical error was encountered), <b>ARCHIVE_EOF</b> 111(end-of-archive was encountered), <b>ARCHIVE_RETRY</b> (the 112operation failed but can be retried), and 113<b>ARCHIVE_FATAL</b> (there was a fatal error; the archive 114should be closed immediately).</p> 115 116<p style="margin-top: 1em"><b>ERRORS</b></p> 117 118<p style="margin-left:6%;">Detailed error codes and textual 119descriptions are available from the <b>archive_errno</b>() 120and <b>archive_error_string</b>() functions.</p> 121 122<p style="margin-top: 1em"><b>SEE ALSO</b></p> 123 124<p style="margin-left:6%;">tar(1), archive_read(3), 125archive_read_data(3), archive_read_filter(3), 126archive_read_format(3), archive_read_open(3), 127archive_read_set_options(3), archive_util(3), libarchive(3), 128tar(5)</p> 129 130<p style="margin-left:6%; margin-top: 1em">BSD 131February 2, 2012 BSD</p> 132<hr> 133</body> 134</html> 135