]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fill in archive_entry_perm() as the read counterpart to
authorTim Kientzle <kientzle@gmail.com>
Sun, 21 Feb 2010 23:52:52 +0000 (18:52 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sun, 21 Feb 2010 23:52:52 +0000 (18:52 -0500)
archive_entry_set_perm().  In inadvertently used this
in the Mac copyfile() support without realizing that it
hadn't actually been implemented.

SVN-Revision: 1947

libarchive/archive_entry.3
libarchive/archive_entry.c
libarchive/archive_entry.h

index 9ceb18b7aad6f47f3b24d60b7626927bf8816811..6464ab940cadeed9cb181793e852325dc9a2c571 100644 (file)
@@ -73,6 +73,7 @@
 .Nm archive_entry_new ,
 .Nm archive_entry_pathname ,
 .Nm archive_entry_pathname_w ,
+.Nm archive_entry_perm ,
 .Nm archive_entry_rdev ,
 .Nm archive_entry_rdevmajor ,
 .Nm archive_entry_rdevminor ,
@@ -90,6 +91,7 @@
 .Nm archive_entry_set_mode ,
 .Nm archive_entry_set_mtime ,
 .Nm archive_entry_set_pathname ,
+.Nm archive_entry_set_perm ,
 .Nm archive_entry_set_rdevmajor ,
 .Nm archive_entry_set_rdevminor ,
 .Nm archive_entry_set_size ,
@@ -355,6 +357,12 @@ There are a few set/get functions that merit additional description:
 .It Fn archive_entry_set_link
 This function sets the symlink field if it is already set.
 Otherwise, it sets the hardlink field.
+.It Fn archive_entry_filetype , Fn archive_entry_set_filetype
+These allow reading and writing of the file type information
+stored in the mode value without affecting the permission bits.
+.It Fn archive_entry_perm , Fn archive_entry_set_perm
+These allow reading and writing the permission bits stored
+in the mode value without affecting the file type information.
 .El
 .Ss File Flags
 File flags are transparently converted between a bitmap
index b328b17dc2c791a979e9e307aeaf49469382d1bc..9b89b812796842654dc134eecf0fbed7c30cbef2 100644 (file)
@@ -705,6 +705,12 @@ archive_entry_pathname_w(struct archive_entry *entry)
        return (aes_get_wcs(&entry->ae_pathname));
 }
 
+mode_t
+archive_entry_perm(struct archive_entry *entry)
+{
+       return (~AE_IFMT & entry->ae_stat.aest_mode);
+}
+
 dev_t
 archive_entry_rdev(struct archive_entry *entry)
 {
index d461a26b64de3a76596ec599f1b3b58513a6668c..103878d261b2c9d10900e9dbe5bf8486e7bdf238 100644 (file)
@@ -222,6 +222,7 @@ __LA_DECL int                archive_entry_mtime_is_set(struct archive_entry *);
 __LA_DECL unsigned int  archive_entry_nlink(struct archive_entry *);
 __LA_DECL const char   *archive_entry_pathname(struct archive_entry *);
 __LA_DECL const wchar_t        *archive_entry_pathname_w(struct archive_entry *);
+__LA_DECL __LA_MODE_T   archive_entry_perm(struct archive_entry *);
 __LA_DECL dev_t                 archive_entry_rdev(struct archive_entry *);
 __LA_DECL dev_t                 archive_entry_rdevmajor(struct archive_entry *);
 __LA_DECL dev_t                 archive_entry_rdevminor(struct archive_entry *);