|
Packit Service |
1d0348 |
ARCHIVE_ENTRY_STAT(3) BSD Library Functions Manual ARCHIVE_ENTRY_STAT(3)
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
NAME
|
|
Packit Service |
1d0348 |
archive_entry_stat, archive_entry_copy_stat, archive_entry_filetype,
|
|
Packit Service |
1d0348 |
archive_entry_set_filetype, archive_entry_mode, archive_entry_set_mode,
|
|
Packit Service |
1d0348 |
archive_entry_size, archive_entry_size_is_set, archive_entry_set_size,
|
|
Packit Service |
1d0348 |
archive_entry_unset_size, archive_entry_dev, archive_entry_set_dev,
|
|
Packit Service |
1d0348 |
archive_entry_dev_is_set, archive_entry_devmajor,
|
|
Packit Service |
1d0348 |
archive_entry_set_devmajor, archive_entry_devminor,
|
|
Packit Service |
1d0348 |
archive_entry_set_devminor, archive_entry_ino, archive_entry_set_ino,
|
|
Packit Service |
1d0348 |
archive_entry_ino_is_set, archive_entry_ino64, archive_entry_set_ino64,
|
|
Packit Service |
1d0348 |
archive_entry_nlink, archive_entry_rdev, archive_entry_set_rdev,
|
|
Packit Service |
1d0348 |
archive_entry_rdevmajor, archive_entry_set_rdevmajor,
|
|
Packit Service |
1d0348 |
archive_entry_rdevminor, archive_entry_set_rdevminor, — accessor func‐
|
|
Packit Service |
1d0348 |
tions for manipulating archive entry descriptions
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
LIBRARY
|
|
Packit Service |
1d0348 |
Streaming Archive Library (libarchive, -larchive)
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
SYNOPSIS
|
|
Packit Service |
1d0348 |
#include <archive_entry.h>
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
const struct stat *
|
|
Packit Service |
1d0348 |
archive_entry_stat(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_copy_stat(struct archive_entry *a, const struct stat *sb);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
mode_t
|
|
Packit Service |
1d0348 |
archive_entry_filetype(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_filetype(struct archive_entry *a, unsigned int type);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
mode_t
|
|
Packit Service |
1d0348 |
archive_entry_mode(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_mode(struct archive_entry *a, mode_t mode);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
int64_t
|
|
Packit Service |
1d0348 |
archive_entry_size(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
int
|
|
Packit Service |
1d0348 |
archive_entry_size_is_set(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_size(struct archive_entry *a, int64_t size);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_unset_size(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
dev_t
|
|
Packit Service |
1d0348 |
archive_entry_dev(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_dev(struct archive_entry *a, dev_t dev);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
int
|
|
Packit Service |
1d0348 |
archive_entry_dev_is_set(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
dev_t
|
|
Packit Service |
1d0348 |
archive_entry_devmajor(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_devmajor(struct archive_entry *a, dev_t major);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
dev_t
|
|
Packit Service |
1d0348 |
archive_entry_devminor(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_devminor(struct archive_entry *a, dev_t minor);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
ino_t
|
|
Packit Service |
1d0348 |
archive_entry_ino(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_ino(struct archive_entry *a, unsigned long ino);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
int
|
|
Packit Service |
1d0348 |
archive_entry_ino_is_set(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
int64_t
|
|
Packit Service |
1d0348 |
archive_entry_ino64(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_ino64(struct archive_entry *a, int64_t ino);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
unsigned int
|
|
Packit Service |
1d0348 |
archive_entry_nlink(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_nlink(struct archive_entry *a, unsigned int count);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
dev_t
|
|
Packit Service |
1d0348 |
archive_entry_rdev(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
dev_t
|
|
Packit Service |
1d0348 |
archive_entry_rdevmajor(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
dev_t
|
|
Packit Service |
1d0348 |
archive_entry_rdevminor(struct archive_entry *a);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_rdev(struct archive_entry *a, dev_t dev);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_rdevmajor(struct archive_entry *a, dev_t major);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
void
|
|
Packit Service |
1d0348 |
archive_entry_set_rdevminor(struct archive_entry *a, dev_t minor);
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
DESCRIPTION
|
|
Packit Service |
1d0348 |
Copying to and from struct stat
|
|
Packit Service |
1d0348 |
The function archive_entry_stat() converts the various fields stored in
|
|
Packit Service |
1d0348 |
the archive entry to the format used by stat(2). The return value
|
|
Packit Service |
1d0348 |
remains valid until either archive_entry_clear() or archive_entry_free()
|
|
Packit Service |
1d0348 |
is called. It is not affected by calls to the set accessor functions.
|
|
Packit Service |
1d0348 |
It currently sets the following values in struct stat: st_atime,
|
|
Packit Service |
1d0348 |
st_ctime, st_dev, st_gid, st_ino, st_mode, st_mtime, st_nlink, st_rdev,
|
|
Packit Service |
1d0348 |
st_size, st_uid. In addition, st_birthtime and high-precision informa‐
|
|
Packit Service |
1d0348 |
tion for time-related fields will be included on platforms that support
|
|
Packit Service |
1d0348 |
it.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
The function archive_entry_copy_stat() copies fields from the platform's
|
|
Packit Service |
1d0348 |
struct stat. Fields not provided by struct stat are unchanged.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
General accessor functions
|
|
Packit Service |
1d0348 |
The functions archive_entry_filetype() and archive_entry_set_filetype()
|
|
Packit Service |
1d0348 |
get respectively set the filetype. The file type is one of the following
|
|
Packit Service |
1d0348 |
constants:
|
|
Packit Service |
1d0348 |
AE_IFREG Regular file
|
|
Packit Service |
1d0348 |
AE_IFLNK Symbolic link
|
|
Packit Service |
1d0348 |
AE_IFSOCK Socket
|
|
Packit Service |
1d0348 |
AE_IFCHR Character device
|
|
Packit Service |
1d0348 |
AE_IFBLK Block device
|
|
Packit Service |
1d0348 |
AE_IFDIR Directory
|
|
Packit Service |
1d0348 |
AE_IFIFO Named pipe (fifo)
|
|
Packit Service |
1d0348 |
Not all file types are supported by all platforms. The constants used by
|
|
Packit Service |
1d0348 |
stat(2) may have different numeric values from the corresponding con‐
|
|
Packit Service |
1d0348 |
stants above.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
The functions archive_entry_mode() and archive_entry_set_mode() get/set a
|
|
Packit Service |
1d0348 |
combination of file type and permissions and provide the equivalent of
|
|
Packit Service |
1d0348 |
st_mode. Use of archive_entry_filetype() and archive_entry_perm() for
|
|
Packit Service |
1d0348 |
getting and archive_entry_set_filetype() and archive_entry_set_perm() for
|
|
Packit Service |
1d0348 |
setting is recommended.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
The function archive_entry_size() returns the file size, if it has been
|
|
Packit Service |
1d0348 |
set, and 0 otherwise. archive_entry_size() can be used to query that
|
|
Packit Service |
1d0348 |
status. archive_entry_set_size() and archive_entry_unset_size() set and
|
|
Packit Service |
1d0348 |
unset the size, respectively.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
The number of references (hardlinks) can be obtained by calling
|
|
Packit Service |
1d0348 |
archive_entry_nlinks() and set with archive_entry_set_nlinks().
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
Identifying unique files
|
|
Packit Service |
1d0348 |
The functions archive_entry_dev() and archive_entry_ino64() are used by
|
|
Packit Service |
1d0348 |
archive_entry_linkify(3) to find hardlinks. The pair of device and inode
|
|
Packit Service |
1d0348 |
is supposed to identify hardlinked files.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
The device major and minor number can be obtained independently using
|
|
Packit Service |
1d0348 |
archive_entry_devmajor() and archive_entry_devminor(). The device can be
|
|
Packit Service |
1d0348 |
set either via archive_entry_set_dev() or by the combination of major and
|
|
Packit Service |
1d0348 |
minor number using archive_entry_set_devmajor() and
|
|
Packit Service |
1d0348 |
archive_entry_set_devminor().
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
The inode number can be obtained using archive_entry_ino(). This is a
|
|
Packit Service |
1d0348 |
legacy interface that uses the platform ino_t, which may be very small.
|
|
Packit Service |
1d0348 |
To set the inode number, archive_entry_set_ino64() is the preferred
|
|
Packit Service |
1d0348 |
interface.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
Accessor functions for block and character devices
|
|
Packit Service |
1d0348 |
Block and character devices are characterised either using a device num‐
|
|
Packit Service |
1d0348 |
ber or a pair of major and minor number. The combined device number can
|
|
Packit Service |
1d0348 |
be obtained with archive_device_rdev() and set with
|
|
Packit Service |
1d0348 |
archive_device_set_rdev(). The major and minor numbers are accessed by
|
|
Packit Service |
1d0348 |
archive_device_rdevmajor(), archive_device_rdevminor()
|
|
Packit Service |
1d0348 |
archive_device_set_rdevmajor() and archive_device_set_rdevminor().
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
The process of splitting the combined device number into major and minor
|
|
Packit Service |
1d0348 |
number and the reverse process of combing them differs between platforms.
|
|
Packit Service |
1d0348 |
Some archive formats use the combined form, while other formats use the
|
|
Packit Service |
1d0348 |
split form.
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
SEE ALSO
|
|
Packit Service |
1d0348 |
archive_entry_acl(3), archive_entry_perms(3), archive_entry_time(3),
|
|
Packit Service |
1d0348 |
libarchive(3), stat(2)
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
BSD February 2, 2012 BSD
|