1 <!-- Creator : groff version 1.22.3 -->
2 <!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4 "http://www.w3.org/TR/html4/loose.dtd">
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 }
23 <p>ARCHIVE_ENTRY_STAT(3) BSD Library Functions Manual
24 ARCHIVE_ENTRY_STAT(3)</p>
26 <p style="margin-top: 1em"><b>NAME</b></p>
28 <p style="margin-left:6%;"><b>archive_entry_stat</b>,
29 <b>archive_entry_copy_stat</b>,
30 <b>archive_entry_filetype</b>,
31 <b>archive_entry_set_filetype</b>,
32 <b>archive_entry_mode</b>, <b>archive_entry_set_mode</b>,
33 <b>archive_entry_size</b>, <b>archive_entry_size_is_set</b>,
34 <b>archive_entry_set_size</b>,
35 <b>archive_entry_unset_size</b>, <b>archive_entry_dev</b>,
36 <b>archive_entry_set_dev</b>,
37 <b>archive_entry_dev_is_set</b>,
38 <b>archive_entry_devmajor</b>,
39 <b>archive_entry_set_devmajor</b>,
40 <b>archive_entry_devminor</b>,
41 <b>archive_entry_set_devminor</b>, <b>archive_entry_ino</b>,
42 <b>archive_entry_set_ino</b>,
43 <b>archive_entry_ino_is_set</b>, <b>archive_entry_ino64</b>,
44 <b>archive_entry_set_ino64</b>, <b>archive_entry_nlink</b>,
45 <b>archive_entry_rdev</b>, <b>archive_entry_set_rdev</b>,
46 <b>archive_entry_rdevmajor</b>,
47 <b>archive_entry_set_rdevmajor</b>,
48 <b>archive_entry_rdevminor</b>,
49 <b>archive_entry_set_rdevminor</b>, — accessor
50 functions for manipulating archive entry descriptions</p>
52 <p style="margin-top: 1em"><b>LIBRARY</b></p>
54 <p style="margin-left:6%;">Streaming Archive Library
55 (libarchive, -larchive)</p>
57 <p style="margin-top: 1em"><b>SYNOPSIS</b></p>
59 <p style="margin-left:6%;"><b>#include
60 <archive_entry.h></b></p>
62 <p style="margin-left:6%; margin-top: 1em"><i>const struct
66 <p style="margin-left:12%;"><b>archive_entry_stat</b>(<i>struct archive_entry *a</i>);</p>
68 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
71 <p style="margin-left:12%;"><b>archive_entry_copy_stat</b>(<i>struct archive_entry *a</i>,
72 <i>const struct stat *sb</i>);</p>
75 <p style="margin-left:6%; margin-top: 1em"><i>mode_t</i></p>
78 <p style="margin-left:12%;"><b>archive_entry_filetype</b>(<i>struct archive_entry *a</i>);</p>
80 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
83 <p style="margin-left:12%;"><b>archive_entry_set_filetype</b>(<i>struct archive_entry *a</i>,
84 <i>unsigned int type</i>);</p>
87 <p style="margin-left:6%; margin-top: 1em"><i>mode_t</i></p>
90 <p style="margin-left:12%;"><b>archive_entry_mode</b>(<i>struct archive_entry *a</i>);</p>
92 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
95 <p style="margin-left:12%;"><b>archive_entry_set_mode</b>(<i>struct archive_entry *a</i>,
96 <i>mode_t mode</i>);</p>
99 <p style="margin-left:6%; margin-top: 1em"><i>int64_t</i></p>
102 <p style="margin-left:12%;"><b>archive_entry_size</b>(<i>struct archive_entry *a</i>);</p>
104 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
107 <p style="margin-left:12%;"><b>archive_entry_size_is_set</b>(<i>struct archive_entry *a</i>);</p>
109 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
112 <p style="margin-left:12%;"><b>archive_entry_set_size</b>(<i>struct archive_entry *a</i>,
113 <i>int64_t size</i>);</p>
115 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
118 <p style="margin-left:12%;"><b>archive_entry_unset_size</b>(<i>struct archive_entry *a</i>);</p>
121 <p style="margin-left:6%; margin-top: 1em"><i>dev_t</i></p>
124 <p style="margin-left:12%;"><b>archive_entry_dev</b>(<i>struct archive_entry *a</i>);</p>
126 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
129 <p style="margin-left:12%;"><b>archive_entry_set_dev</b>(<i>struct archive_entry *a</i>,
130 <i>dev_t dev</i>);</p>
132 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
135 <p style="margin-left:12%;"><b>archive_entry_dev_is_set</b>(<i>struct archive_entry *a</i>);</p>
138 <p style="margin-left:6%; margin-top: 1em"><i>dev_t</i></p>
141 <p style="margin-left:12%;"><b>archive_entry_devmajor</b>(<i>struct archive_entry *a</i>);</p>
143 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
146 <p style="margin-left:12%;"><b>archive_entry_set_devmajor</b>(<i>struct archive_entry *a</i>,
147 <i>dev_t major</i>);</p>
150 <p style="margin-left:6%; margin-top: 1em"><i>dev_t</i></p>
153 <p style="margin-left:12%;"><b>archive_entry_devminor</b>(<i>struct archive_entry *a</i>);</p>
155 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
158 <p style="margin-left:12%;"><b>archive_entry_set_devminor</b>(<i>struct archive_entry *a</i>,
159 <i>dev_t minor</i>);</p>
162 <p style="margin-left:6%; margin-top: 1em"><i>ino_t</i></p>
165 <p style="margin-left:12%;"><b>archive_entry_ino</b>(<i>struct archive_entry *a</i>);</p>
167 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
170 <p style="margin-left:12%;"><b>archive_entry_set_ino</b>(<i>struct archive_entry *a</i>,
171 <i>unsigned long ino</i>);</p>
173 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
176 <p style="margin-left:12%;"><b>archive_entry_ino_is_set</b>(<i>struct archive_entry *a</i>);</p>
179 <p style="margin-left:6%; margin-top: 1em"><i>int64_t</i></p>
182 <p style="margin-left:12%;"><b>archive_entry_ino64</b>(<i>struct archive_entry *a</i>);</p>
184 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
187 <p style="margin-left:12%;"><b>archive_entry_set_ino64</b>(<i>struct archive_entry *a</i>,
188 <i>int64_t ino</i>);</p>
190 <p style="margin-left:6%; margin-top: 1em"><i>unsigned
194 <p style="margin-left:12%;"><b>archive_entry_nlink</b>(<i>struct archive_entry *a</i>);</p>
196 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
199 <p style="margin-left:12%;"><b>archive_entry_set_nlink</b>(<i>struct archive_entry *a</i>,
200 <i>unsigned int count</i>);</p>
203 <p style="margin-left:6%; margin-top: 1em"><i>dev_t</i></p>
206 <p style="margin-left:12%;"><b>archive_entry_rdev</b>(<i>struct archive_entry *a</i>);</p>
209 <p style="margin-left:6%; margin-top: 1em"><i>dev_t</i></p>
212 <p style="margin-left:12%;"><b>archive_entry_rdevmajor</b>(<i>struct archive_entry *a</i>);</p>
215 <p style="margin-left:6%; margin-top: 1em"><i>dev_t</i></p>
218 <p style="margin-left:12%;"><b>archive_entry_rdevminor</b>(<i>struct archive_entry *a</i>);</p>
220 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
223 <p style="margin-left:12%;"><b>archive_entry_set_rdev</b>(<i>struct archive_entry *a</i>,
224 <i>dev_t dev</i>);</p>
226 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
229 <p style="margin-left:12%;"><b>archive_entry_set_rdevmajor</b>(<i>struct archive_entry *a</i>,
230 <i>dev_t major</i>);</p>
232 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
235 <p style="margin-left:12%;"><b>archive_entry_set_rdevminor</b>(<i>struct archive_entry *a</i>,
236 <i>dev_t minor</i>);</p>
238 <p style="margin-top: 1em"><b>DESCRIPTION</b></p>
240 <p style="margin-left:6%;"><b>Copying to and from</b>
241 <i>struct stat</i> <br>
242 The function <b>archive_entry_stat</b>() converts the
243 various fields stored in the archive entry to the format
244 used by stat(2). The return value remains valid until either
245 <b>archive_entry_clear</b>() or <b>archive_entry_free</b>()
246 is called. It is not affected by calls to the set accessor
247 functions. It currently sets the following values in
248 <i>struct stat</i>: <i>st_atime</i>, <i>st_ctime</i>,
249 <i>st_dev</i>, <i>st_gid</i>, <i>st_ino</i>, <i>st_mode</i>,
250 <i>st_mtime</i>, <i>st_nlink</i>, <i>st_rdev</i>,
251 <i>st_size</i>, <i>st_uid</i>. In addition,
252 <i>st_birthtime</i> and high-precision information for
253 time-related fields will be included on platforms that
256 <p style="margin-left:6%; margin-top: 1em">The function
257 <b>archive_entry_copy_stat</b>() copies fields from the
258 platform’s <i>struct stat</i>. Fields not provided by
259 <i>struct stat</i> are unchanged.</p>
261 <p style="margin-left:6%; margin-top: 1em"><b>General
262 accessor functions</b> <br>
263 The functions <b>archive_entry_filetype</b>() and
264 <b>archive_entry_set_filetype</b>() get respectively set the
265 filetype. The file type is one of the following
270 <p style="margin-left:28%; margin-top: 1em">Regular
275 <p style="margin-left:28%; margin-top: 1em">Symbolic
280 <p style="margin-left:28%; margin-top: 1em">Socket</p>
284 <p style="margin-left:28%; margin-top: 1em">Character
289 <p style="margin-left:28%; margin-top: 1em">Block
294 <p style="margin-left:28%; margin-top: 1em">Directory</p>
298 <p style="margin-left:28%; margin-top: 1em">Named pipe
301 <p style="margin-left:6%;">Not all file types are supported
302 by all platforms. The constants used by stat(2) may have
303 different numeric values from the corresponding constants
306 <p style="margin-left:6%; margin-top: 1em">The functions
307 <b>archive_entry_mode</b>() and
308 <b>archive_entry_set_mode</b>() get/set a combination of
309 file type and permissions and provide the equivalent of
310 <i>st_mode</i>. Use of <b>archive_entry_filetype</b>() and
311 <b>archive_entry_perm</b>() for getting and
312 <b>archive_entry_set_filetype</b>() and
313 <b>archive_entry_set_perm</b>() for setting is
316 <p style="margin-left:6%; margin-top: 1em">The function
317 <b>archive_entry_size</b>() returns the file size, if it has
318 been set, and 0 otherwise. <b>archive_entry_size</b>() can
319 be used to query that status.
320 <b>archive_entry_set_size</b>() and
321 <b>archive_entry_unset_size</b>() set and unset the size,
324 <p style="margin-left:6%; margin-top: 1em">The number of
325 references (hardlinks) can be obtained by calling
326 <b>archive_entry_nlinks</b>() and set with
327 <b>archive_entry_set_nlinks</b>().</p>
329 <p style="margin-left:6%; margin-top: 1em"><b>Identifying
330 unique files</b> <br>
331 The functions <b>archive_entry_dev</b>() and
332 <b>archive_entry_ino64</b>() are used by
333 archive_entry_linkify(3) to find hardlinks. The pair of
334 device and inode is supposed to identify hardlinked
337 <p style="margin-left:6%; margin-top: 1em">The device major
338 and minor number can be obtained independently using
339 <b>archive_entry_devmajor</b>() and
340 <b>archive_entry_devminor</b>(). The device can be set
341 either via <b>archive_entry_set_dev</b>() or by the
342 combination of major and minor number using
343 <b>archive_entry_set_devmajor</b>() and
344 <b>archive_entry_set_devminor</b>().</p>
346 <p style="margin-left:6%; margin-top: 1em">The inode number
347 can be obtained using <b>archive_entry_ino</b>(). This is a
348 legacy interface that uses the platform <i>ino_t</i>, which
349 may be very small. To set the inode number,
350 <b>archive_entry_set_ino64</b>() is the preferred
353 <p style="margin-left:6%; margin-top: 1em"><b>Accessor
354 functions for block and character devices</b> <br>
355 Block and character devices are characterised either using a
356 device number or a pair of major and minor number. The
357 combined device number can be obtained with
358 <b>archive_device_rdev</b>() and set with
359 <b>archive_device_set_rdev</b>(). The major and minor
360 numbers are accessed by <b>archive_device_rdevmajor</b>(),
361 <b>archive_device_rdevminor</b>()
362 <b>archive_device_set_rdevmajor</b>() and
363 <b>archive_device_set_rdevminor</b>().</p>
365 <p style="margin-left:6%; margin-top: 1em">The process of
366 splitting the combined device number into major and minor
367 number and the reverse process of combing them differs
368 between platforms. Some archive formats use the combined
369 form, while other formats use the split form.</p>
371 <p style="margin-top: 1em"><b>SEE ALSO</b></p>
373 <p style="margin-left:6%;">archive_entry_acl(3),
374 archive_entry_perms(3), archive_entry_time(3),
375 libarchive(3), stat(2)</p>
377 <p style="margin-left:6%; margin-top: 1em">BSD
378 February 2, 2012 BSD</p>