From: Joerg Sonnenberger Date: Mon, 22 Feb 2010 04:11:58 +0000 (-0500) Subject: Add description of archive_entry_perm/archive_entry_set_perm and X-Git-Tag: v3.0.0a~1206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01a67813a6251cf9170e9e9c30bdebcf809cce89;p=thirdparty%2Flibarchive.git Add description of archive_entry_perm/archive_entry_set_perm and the interaction with archive_entry_set_mode. Move the description of the latter to archive_entry_stat.3, where archive_entry_filetype and co are. SVN-Revision: 1959 --- diff --git a/libarchive/archive_entry_perms.3 b/libarchive/archive_entry_perms.3 index 31f526817..d0b724066 100644 --- a/libarchive/archive_entry_perms.3 +++ b/libarchive/archive_entry_perms.3 @@ -31,8 +31,8 @@ .Nm archive_entry_set_gid , .Nm archive_entry_uid , .Nm archive_entry_set_uid , -.Nm archive_entry_mode , -.Nm archive_entry_set_mode , +.Nm archive_entry_perm , +.Nm archive_entry_set_perm , .Nm archive_entry_strmode , .Nm archive_entry_uname .Nm archive_entry_uname_w @@ -63,9 +63,9 @@ .Ft void .Fn archive_entry_set_uid "struct archive_entry *a" "uid_t uid" .Ft mode_t -.Fn archive_entry_mode "struct archive_entry *a" +.Fn archive_entry_perm "struct archive_entry *a" .Ft void -.Fn archive_entry_set_mode "struct archive_entry *a" "mode_t mode" +.Fn archive_entry_set_perm "struct archive_entry *a" "mode_t mode" .Ft const char * .Fn archive_entry_strmode "struct archive_entry *a" .Ft const char * @@ -116,17 +116,19 @@ The functions .Fn archive_entry_uid , .Fn archive_entry_gid , and -.Fn archive_entry_mode -can be used to extract the user id, group id and mode from the given entry. +.Fn archive_entry_perm +can be used to extract the user id, group id and permission from the given entry. The corresponding functions .Fn archive_entry_set_uid , .Fn archive_entry_set_gid , and -.Fn archive_entry_set_mode -store the given user id, group id and mode in the entry. +.Fn archive_entry_set_perm +store the given user id, group id and permission in the entry. +The permission is also set as side effect of calling +.Fn archive_entry_set_mode . .Pp .Fn archive_entry_strmode -returns a string representation of the mode as used by the long mode of +returns a string representation of the permission as used by the long mode of .Xr ls 1 . .Ss User and group name User and group names can be provided in one of three different ways: diff --git a/libarchive/archive_entry_stat.3 b/libarchive/archive_entry_stat.3 index 63d67153f..b43912349 100644 --- a/libarchive/archive_entry_stat.3 +++ b/libarchive/archive_entry_stat.3 @@ -30,6 +30,8 @@ .Nm archive_entry_copy_stat , .Nm archive_entry_filetype , .Nm archive_entry_set_filetype , +.Nm archive_entry_mode , +.Nm archive_entry_set_mode , .Nm archive_entry_size , .Nm archive_entry_size_is_set , .Nm archive_entry_set_size , @@ -62,6 +64,10 @@ .Fn archive_entry_filetype "struct archive_entry *a" .Ft void .Fn archive_entry_set_filetype "struct archive_entry *a" "unsigned int type" +.Ft mode_t +.Fn archive_entry_mode "struct archive_entry *a" +.Ft void +.Fn archive_entry_set_mode "struct archive_entry *a" "mode_t mode" .Ft int64_t .Fn archive_entry_size "struct archive_entry *a" .Ft int @@ -153,6 +159,21 @@ The constants used by .Xr stat 2 may have different numeric value. .Pp +The functions +.Fn archive_entry_mode +and +.Fn archive_entry_set_mode +get/set a combination of file type and permissions. +Use of +.Fn archive_entry_filetype +and +.Fn archive_entry_perm +for getting and +.Fn archive_entry_set_filetype +and +.Fn archive_entry_set_perm +for setting is recommented. +.Pp The function .Fn archive_entry_size returns the file size, if it has been set, and 0 otherwise.