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_PERMS(3) BSD Library Functions Manual
24 ARCHIVE_ENTRY_PERMS(3)</p>
26 <p style="margin-top: 1em"><b>NAME</b></p>
28 <p style="margin-left:6%;"><b>archive_entry_gid</b>,
29 <b>archive_entry_set_gid</b>, <b>archive_entry_uid</b>,
30 <b>archive_entry_set_uid</b>, <b>archive_entry_perm</b>,
31 <b>archive_entry_set_perm</b>, <b>archive_entry_strmode</b>,
32 <b>archive_entry_uname archive_entry_uname_w
33 archive_entry_set_uname</b>,
34 <b>archive_entry_copy_uname</b>,
35 <b>archive_entry_copy_uname_w</b>,
36 <b>archive_entry_update_uname_utf8</b>,
37 <b>archive_entry_gname</b>, <b>archive_entry_gname_w</b>,
38 <b>archive_entry_set_gname</b>,
39 <b>archive_entry_copy_gname</b>,
40 <b>archive_entry_copy_gname_w</b>,
41 <b>archive_entry_update_gname_utf8</b>,
42 <b>archive_entry_fflags</b>,
43 <b>archive_entry_fflags_text</b>,
44 <b>archive_entry_set_fflags</b>,
45 <b>archive_entry_copy_fflags_text</b>,
46 <b>archive_entry_copy_fflags_text_w</b> — functions
47 for manipulating ownership and permissions in archive entry
50 <p style="margin-top: 1em"><b>LIBRARY</b></p>
52 <p style="margin-left:6%;">Streaming Archive Library
53 (libarchive, -larchive)</p>
55 <p style="margin-top: 1em"><b>SYNOPSIS</b></p>
57 <p style="margin-left:6%;"><b>#include
58 <archive_entry.h></b></p>
61 <p style="margin-left:6%; margin-top: 1em"><i>gid_t</i></p>
64 <p style="margin-left:12%;"><b>archive_entry_gid</b>(<i>struct archive_entry *a</i>);</p>
66 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
69 <p style="margin-left:12%;"><b>archive_entry_set_gid</b>(<i>struct archive_entry *a</i>,
70 <i>gid_t gid</i>);</p>
73 <p style="margin-left:6%; margin-top: 1em"><i>uid_t</i></p>
76 <p style="margin-left:12%;"><b>archive_entry_uid</b>(<i>struct archive_entry *a</i>);</p>
78 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
81 <p style="margin-left:12%;"><b>archive_entry_set_uid</b>(<i>struct archive_entry *a</i>,
82 <i>uid_t uid</i>);</p>
85 <p style="margin-left:6%; margin-top: 1em"><i>mode_t</i></p>
88 <p style="margin-left:12%;"><b>archive_entry_perm</b>(<i>struct archive_entry *a</i>);</p>
90 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
93 <p style="margin-left:12%;"><b>archive_entry_set_perm</b>(<i>struct archive_entry *a</i>,
94 <i>mode_t mode</i>);</p>
96 <p style="margin-left:6%; margin-top: 1em"><i>const char
100 <p style="margin-left:12%;"><b>archive_entry_strmode</b>(<i>struct archive_entry *a</i>);</p>
102 <p style="margin-left:6%; margin-top: 1em"><i>const char
106 <p style="margin-left:12%;"><b>archive_entry_gname</b>(<i>struct archive_entry *a</i>);</p>
108 <p style="margin-left:6%; margin-top: 1em"><i>const wchar_t
112 <p style="margin-left:12%;"><b>archive_entry_gname_w</b>(<i>struct archive_entry *a</i>);</p>
114 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
117 <p style="margin-left:12%;"><b>archive_entry_set_gname</b>(<i>struct archive_entry *a</i>,
118 <i>const char *a</i>);</p>
120 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
123 <p style="margin-left:12%;"><b>archive_entry_copy_gname</b>(<i>struct archive_entry *a</i>,
124 <i>const char *name</i>);</p>
126 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
129 <p style="margin-left:12%;"><b>archive_entry_copy_gname_w</b>(<i>struct archive_entry *a</i>,
130 <i>const wchar_t *name</i>);</p>
132 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
135 <p style="margin-left:12%;"><b>archive_entry_update_gname_utf8</b>(<i>struct archive_entry *a</i>,
136 <i>const char *name</i>);</p>
138 <p style="margin-left:6%; margin-top: 1em"><i>const char
142 <p style="margin-left:12%;"><b>archive_entry_uname</b>(<i>struct archive_entry *a</i>);</p>
144 <p style="margin-left:6%; margin-top: 1em"><i>const wchar_t
148 <p style="margin-left:12%;"><b>archive_entry_uname_w</b>(<i>struct archive_entry *a</i>);</p>
150 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
153 <p style="margin-left:12%;"><b>archive_entry_set_uname</b>(<i>struct archive_entry *a</i>,
154 <i>const char *name</i>);</p>
156 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
159 <p style="margin-left:12%;"><b>archive_entry_copy_uname</b>(<i>struct archive_entry *a</i>,
160 <i>const char *name</i>);</p>
162 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
165 <p style="margin-left:12%;"><b>archive_entry_copy_uname_w</b>(<i>struct archive_entry *a</i>,
166 <i>const wchar_t *name</i>);</p>
168 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
171 <p style="margin-left:12%;"><b>archive_entry_update_uname_utf8</b>(<i>struct archive_entry *a</i>,
172 <i>const char *name</i>);</p>
174 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
177 <p><b>archive_entry_fflags</b>(<i>struct archive_entry *a</i>,
178 <i>unsigned long *set_bits</i>,
179 <i>unsigned long *clear_bits</i>);</p>
181 <p style="margin-left:6%; margin-top: 1em"><i>const char
185 <p style="margin-left:12%;"><b>archive_entry_fflags_text</b>(<i>struct archive_entry *a</i>);</p>
187 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
190 <p><b>archive_entry_set_fflags</b>(<i>struct archive_entry *a</i>,
191 <i>unsigned long set_bits</i>,
192 <i>unsigned long clear_bits</i>);</p>
194 <p style="margin-left:6%; margin-top: 1em"><i>const char
198 <p style="margin-left:12%;"><b>archive_entry_copy_fflags_text</b>(<i>struct archive_entry *a</i>,
199 <i>const char *text</i>);</p>
201 <p style="margin-left:6%; margin-top: 1em"><i>const wchar_t
205 <p style="margin-left:12%;"><b>archive_entry_copy_fflags_text_w</b>(<i>struct archive_entry *a</i>,
206 <i>const wchar_t *text</i>);</p>
208 <p style="margin-top: 1em"><b>DESCRIPTION</b></p>
210 <p style="margin-left:6%;"><b>User id, group id and
212 The functions <b>archive_entry_uid</b>(),
213 <b>archive_entry_gid</b>(), and <b>archive_entry_perm</b>()
214 can be used to extract the user id, group id and permission
215 from the given entry. The corresponding functions
216 <b>archive_entry_set_uid</b>(),
217 <b>archive_entry_set_gid</b>(), and
218 <b>archive_entry_set_perm</b>() store the given user id,
219 group id and permission in the entry. The permission is also
220 set as side effect of calling
221 <b>archive_entry_set_mode</b>().</p>
224 <p style="margin-left:6%; margin-top: 1em"><b>archive_entry_strmode</b>()
225 returns a string representation of the permission as used by
226 the long mode of ls(1).</p>
228 <p style="margin-left:6%; margin-top: 1em"><b>User and
230 User and group names can be provided in one of three
233 <p style="margin-top: 1em">char *</p>
235 <p style="margin-left:21%; margin-top: 1em">Multibyte
236 strings in the current locale.</p>
238 <p style="margin-top: 1em">wchar_t *</p>
240 <p style="margin-left:21%; margin-top: 1em">Wide character
241 strings in the current locale. The accessor functions are
242 named <b>XXX_w</b>().</p>
244 <p style="margin-top: 1em">UTF-8</p>
246 <p style="margin-left:21%; margin-top: 1em">Unicode strings
247 encoded as UTF-8. This are convience functions to update
248 both the multibyte and wide character strings at the same
252 <p style="margin-left:6%; margin-top: 1em"><b>archive_entry_set_XXX</b>()
253 is an alias for <b>archive_entry_copy_XXX</b>().</p>
255 <p style="margin-left:6%; margin-top: 1em"><b>File
257 File flags are transparently converted between a bitmap
258 representation and a textual format. For example, if you set
259 the bitmap and ask for text, the library will build a
260 canonical text format. However, if you set a text format and
261 request a text format, you will get back the same text, even
262 if it is ill-formed. If you need to canonicalize a textual
263 flags string, you should first set the text form, then
264 request the bitmap form, then use that to set the bitmap
265 form. Setting the bitmap format will clear the internal text
266 representation and force it to be reconstructed when you
267 next request the text form.</p>
269 <p style="margin-left:6%; margin-top: 1em">The bitmap
270 format consists of two integers, one containing bits that
271 should be set, the other specifying bits that should be
272 cleared. Bits not mentioned in either bitmap will be
273 ignored. Usually, the bitmap of bits to be cleared will be
274 set to zero. In unusual circumstances, you can force a
275 fully-specified set of file flags by setting the bitmap of
276 flags to clear to the complement of the bitmap of flags to
277 set. (This differs from fflagstostr(3), which only includes
278 names for set bits.) Converting a bitmap to a textual string
279 is a platform-specific operation; bits that are not
280 meaningful on the current platform will be ignored.</p>
282 <p style="margin-left:6%; margin-top: 1em">The canonical
283 text format is a comma-separated list of flag names. The
284 <b>archive_entry_copy_fflags_text</b>() and
285 <b>archive_entry_copy_fflags_text_w</b>() functions parse
286 the provided text and sets the internal bitmap values. This
287 is a platform-specific operation; names that are not
288 meaningful on the current platform will be ignored. The
289 function returns a pointer to the start of the first name
290 that was not recognized, or NULL if every name was
291 recognized. Note that every name — including names
292 that follow an unrecognized name — will be evaluated,
293 and the bitmaps will be set to reflect every name that is
294 recognized. (In particular, this differs from
295 strtofflags(3), which stops parsing at the first
296 unrecognized name.)</p>
298 <p style="margin-top: 1em"><b>SEE ALSO</b></p>
300 <p style="margin-left:6%;">archive_entry(3),
301 archive_entry_acl(3), archive_read_disk(3),
302 archive_write_disk(3) libarchive(3),</p>
304 <p style="margin-top: 1em"><b>BUGS</b></p>
306 <p style="margin-left:6%;">The platform types <i>uid_t</i>
307 and <i>gid_t</i> are often 16 or 32 bit wide. In this case
308 it is possible that the ids can not be correctly restored
309 from archives and get truncated.</p>
311 <p style="margin-left:6%; margin-top: 1em">BSD
312 February 2, 2012 BSD</p>