1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
|
<!-- Creator : groff version 1.23.0 -->
<!-- CreationDate: Mon Jan 5 10:42:43 2026 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title></title>
</head>
<body>
<hr>
<p><i>ARCHIVE_ENTRY_STAT</i>(3) Library Functions Manual
<i>ARCHIVE_ENTRY_STAT</i>(3)</p>
<p style="margin-top: 1em"><b>NAME</b></p>
<p style="margin-left:9%;">archive_entry_stat,
archive_entry_copy_stat, archive_entry_filetype,
archive_entry_set_filetype, archive_entry_mode,
archive_entry_set_mode, archive_entry_size,
archive_entry_size_is_set, archive_entry_set_size,
archive_entry_unset_size, archive_entry_dev,
archive_entry_set_dev, archive_entry_dev_is_set,
archive_entry_devmajor, archive_entry_set_devmajor,
archive_entry_devminor, archive_entry_set_devminor,
archive_entry_ino, archive_entry_set_ino,
archive_entry_ino_is_set, archive_entry_ino64,
archive_entry_set_ino64, archive_entry_nlink,
archive_entry_rdev, archive_entry_set_rdev,
archive_entry_rdevmajor, archive_entry_set_rdevmajor,
archive_entry_rdevminor, archive_entry_set_rdevminor —
accessor functions for manipulating archive entry
descriptions</p>
<p style="margin-top: 1em"><b>LIBRARY</b></p>
<p style="margin-left:9%;">Streaming Archive Library
(libarchive, -larchive)</p>
<p style="margin-top: 1em"><b>SYNOPSIS</b></p>
<p style="margin-left:9%;"><b>#include
<archive_entry.h></b></p>
<p style="margin-left:9%; margin-top: 1em"><i>const struct
stat *</i></p>
<p style="margin-left:14%;"><b>archive_entry_stat</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_copy_stat</b>(<i>struct archive_entry *a</i>,
<i>const struct stat *sb</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>mode_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_filetype</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_filetype</b>(<i>struct archive_entry *a</i>,
<i>unsigned int type</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>mode_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_mode</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_mode</b>(<i>struct archive_entry *a</i>,
<i>mode_t mode</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>int64_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_size</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>int</i></p>
<p style="margin-left:14%;"><b>archive_entry_size_is_set</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_size</b>(<i>struct archive_entry *a</i>,
<i>int64_t size</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_unset_size</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>dev_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_dev</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_dev</b>(<i>struct archive_entry *a</i>,
<i>dev_t dev</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>int</i></p>
<p style="margin-left:14%;"><b>archive_entry_dev_is_set</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>dev_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_devmajor</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_devmajor</b>(<i>struct archive_entry *a</i>,
<i>dev_t major</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>dev_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_devminor</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_devminor</b>(<i>struct archive_entry *a</i>,
<i>dev_t minor</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>ino_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_ino</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_ino</b>(<i>struct archive_entry *a</i>,
<i>unsigned long ino</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>int</i></p>
<p style="margin-left:14%;"><b>archive_entry_ino_is_set</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>int64_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_ino64</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_ino64</b>(<i>struct archive_entry *a</i>,
<i>int64_t ino</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>unsigned
int</i></p>
<p style="margin-left:14%;"><b>archive_entry_nlink</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_nlink</b>(<i>struct archive_entry *a</i>,
<i>unsigned int count</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>dev_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_rdev</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>dev_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_rdevmajor</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>dev_t</i></p>
<p style="margin-left:14%;"><b>archive_entry_rdevminor</b>(<i>struct archive_entry *a</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_rdev</b>(<i>struct archive_entry *a</i>,
<i>dev_t dev</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_rdevmajor</b>(<i>struct archive_entry *a</i>,
<i>dev_t major</i>);</p>
<p style="margin-left:9%; margin-top: 1em"><i>void</i></p>
<p style="margin-left:14%;"><b>archive_entry_set_rdevminor</b>(<i>struct archive_entry *a</i>,
<i>dev_t minor</i>);</p>
<p style="margin-top: 1em"><b>DESCRIPTION</b></p>
<p style="margin-left:4%;"><b>Copying to and from</b>
<b><i>struct stat</i></b></p>
<p style="margin-left:9%;">The function
<b>archive_entry_stat</b>() converts the various fields
stored in the archive entry to the format used by
<i>stat</i>(2). The return value remains valid until either
<b>archive_entry_clear</b>() or <b>archive_entry_free</b>()
is called. It is not affected by calls to the set accessor
functions. It currently sets the following values in
<i>struct stat</i>: <i>st_atime</i>, <i>st_ctime</i>,
<i>st_dev</i>, <i>st_gid</i>, <i>st_ino</i>, <i>st_mode</i>,
<i>st_mtime</i>, <i>st_nlink</i>, <i>st_rdev</i>,
<i>st_size</i>, <i>st_uid</i>. In addition,
<i>st_birthtime</i> and high-precision information for
time-related fields will be included on platforms that
support it.</p>
<p style="margin-left:9%; margin-top: 1em">The function
<b>archive_entry_copy_stat</b>() copies fields from the
platform’s <i>struct stat</i>. Fields not provided by
<i>struct stat</i> are unchanged.</p>
<p style="margin-left:4%; margin-top: 1em"><b>General
accessor functions</b></p>
<p style="margin-left:9%;">The functions
<b>archive_entry_filetype</b>() and
<b>archive_entry_set_filetype</b>() get respectively set the
filetype. The file type is one of the following
constants:</p>
<p>AE_IFREG</p>
<p style="margin-left:31%; margin-top: 1em">Regular
file</p>
<p>AE_IFLNK</p>
<p style="margin-left:31%; margin-top: 1em">Symbolic
link</p>
<p>AE_IFSOCK</p>
<p style="margin-left:31%; margin-top: 1em">Socket</p>
<p>AE_IFCHR</p>
<p style="margin-left:31%; margin-top: 1em">Character
device</p>
<p>AE_IFBLK</p>
<p style="margin-left:31%; margin-top: 1em">Block
device</p>
<p>AE_IFDIR</p>
<p style="margin-left:31%; margin-top: 1em">Directory</p>
<p>AE_IFIFO</p>
<p style="margin-left:31%; margin-top: 1em">Named pipe
(fifo)</p>
<p style="margin-left:9%;">Not all file types are supported
by all platforms. The constants used by <i>stat</i>(2) may
have different numeric values from the corresponding
constants above.</p>
<p style="margin-left:9%; margin-top: 1em">The functions
<b>archive_entry_mode</b>() and
<b>archive_entry_set_mode</b>() get/set a combination of
file type and permissions and provide the equivalent of
<i>st_mode</i>. Use of <b>archive_entry_filetype</b>() and
<b>archive_entry_perm</b>() for getting and
<b>archive_entry_set_filetype</b>() and
<b>archive_entry_set_perm</b>() for setting is
recommended.</p>
<p style="margin-left:9%; margin-top: 1em">The function
<b>archive_entry_size</b>() returns the file size, if it has
been set, and 0 otherwise.
<b>archive_entry_size_is_set</b>() can be used to query that
status. <b>archive_entry_set_size</b>() and
<b>archive_entry_unset_size</b>() set and unset the size,
respectively.</p>
<p style="margin-left:9%; margin-top: 1em">The number of
references (hardlinks) can be obtained by calling
<b>archive_entry_nlink</b>() and set with
<b>archive_entry_set_nlink</b>().</p>
<p style="margin-left:4%; margin-top: 1em"><b>Identifying
unique files</b></p>
<p style="margin-left:9%;">The functions
<b>archive_entry_dev</b>() and <b>archive_entry_ino64</b>()
are used by <i>archive_entry_linkify</i>(3) to find
hardlinks. The pair of device and inode is supposed to
identify hardlinked files.</p>
<p style="margin-left:9%; margin-top: 1em">The device major
and minor number can be obtained independently using
<b>archive_entry_devmajor</b>() and
<b>archive_entry_devminor</b>(). The device can be set
either via <b>archive_entry_set_dev</b>() or by the
combination of major and minor number using
<b>archive_entry_set_devmajor</b>() and
<b>archive_entry_set_devminor</b>().</p>
<p style="margin-left:9%; margin-top: 1em">The inode number
can be obtained using <b>archive_entry_ino</b>(). This is a
legacy interface that uses the platform <i>ino_t</i>, which
may be very small. To set the inode number,
<b>archive_entry_set_ino64</b>() is the preferred
interface.</p>
<p style="margin-left:4%; margin-top: 1em"><b>Accessor
functions for block and character devices</b></p>
<p style="margin-left:9%;">Block and character devices are
characterised either using a device number or a pair of
major and minor number. The combined device number can be
obtained with <b>archive_device_rdev</b>() and set with
<b>archive_device_set_rdev</b>(). The major and minor
numbers are accessed by <b>archive_device_rdevmajor</b>(),
<b>archive_device_rdevminor</b>()
<b>archive_device_set_rdevmajor</b>() and
<b>archive_device_set_rdevminor</b>().</p>
<p style="margin-left:9%; margin-top: 1em">The process of
splitting the combined device number into major and minor
number and the reverse process of combing them differs
between platforms. Some archive formats use the combined
form, while other formats use the split form.</p>
<p style="margin-top: 1em"><b>SEE ALSO</b></p>
<p style="margin-left:9%;"><i>stat</i>(2),
<i>archive_entry_acl</i>(3), <i>archive_entry_perms</i>(3),
<i>archive_entry_time</i>(3), <i>libarchive</i>(3) Debian
February 2, 2012 <i>ARCHIVE_ENTRY_STAT</i>(3)</p>
<hr>
</body>
</html>
|