diff options
Diffstat (limited to 'archivers/libarchive/files/doc/html/archive_read_disk.3.html')
-rw-r--r-- | archivers/libarchive/files/doc/html/archive_read_disk.3.html | 1106 |
1 files changed, 341 insertions, 765 deletions
diff --git a/archivers/libarchive/files/doc/html/archive_read_disk.3.html b/archivers/libarchive/files/doc/html/archive_read_disk.3.html index 958f9674f9e..cbba421d666 100644 --- a/archivers/libarchive/files/doc/html/archive_read_disk.3.html +++ b/archivers/libarchive/files/doc/html/archive_read_disk.3.html @@ -1,765 +1,341 @@ -%!PS-Adobe-3.0 -%%Creator: groff version 1.19.2 -%%CreationDate: Sun Mar 14 02:49:16 2010 -%%DocumentNeededResources: font Times-Roman -%%DocumentSuppliedResources: procset grops 1.19 2 -%%Pages: 53 -%%PageOrder: Ascend -%%DocumentMedia: Default 612 792 0 () () -%%Orientation: Portrait -%%EndComments -%%BeginDefaults -%%PageMedia: Default -%%EndDefaults -%%BeginProlog -%%BeginResource: procset grops 1.19 2 -%!PS-Adobe-3.0 Resource-ProcSet -/setpacking where{ -pop -currentpacking -true setpacking -}if -/grops 120 dict dup begin -/SC 32 def -/A/show load def -/B{0 SC 3 -1 roll widthshow}bind def -/C{0 exch ashow}bind def -/D{0 exch 0 SC 5 2 roll awidthshow}bind def -/E{0 rmoveto show}bind def -/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def -/G{0 rmoveto 0 exch ashow}bind def -/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/I{0 exch rmoveto show}bind def -/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def -/K{0 exch rmoveto 0 exch ashow}bind def -/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/M{rmoveto show}bind def -/N{rmoveto 0 SC 3 -1 roll widthshow}bind def -/O{rmoveto 0 exch ashow}bind def -/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/Q{moveto show}bind def -/R{moveto 0 SC 3 -1 roll widthshow}bind def -/S{moveto 0 exch ashow}bind def -/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/SF{ -findfont exch -[exch dup 0 exch 0 exch neg 0 0]makefont -dup setfont -[exch/setfont cvx]cvx bind def -}bind def -/MF{ -findfont -[5 2 roll -0 3 1 roll -neg 0 0]makefont -dup setfont -[exch/setfont cvx]cvx bind def -}bind def -/level0 0 def -/RES 0 def -/PL 0 def -/LS 0 def -/MANUAL{ -statusdict begin/manualfeed true store end -}bind def -/PLG{ -gsave newpath clippath pathbbox grestore -exch pop add exch pop -}bind def -/BP{ -/level0 save def -1 setlinecap -1 setlinejoin -72 RES div dup scale -LS{ -90 rotate -}{ -0 PL translate -}ifelse -1 -1 scale -}bind def -/EP{ -level0 restore -showpage -}def -/DA{ -newpath arcn stroke -}bind def -/SN{ -transform -.25 sub exch .25 sub exch -round .25 add exch round .25 add exch -itransform -}bind def -/DL{ -SN -moveto -SN -lineto stroke -}bind def -/DC{ -newpath 0 360 arc closepath -}bind def -/TM matrix def -/DE{ -TM currentmatrix pop -translate scale newpath 0 0 .5 0 360 arc closepath -TM setmatrix -}bind def -/RC/rcurveto load def -/RL/rlineto load def -/ST/stroke load def -/MT/moveto load def -/CL/closepath load def -/Fr{ -setrgbcolor fill -}bind def -/setcmykcolor where{ -pop -/Fk{ -setcmykcolor fill -}bind def -}if -/Fg{ -setgray fill -}bind def -/FL/fill load def -/LW/setlinewidth load def -/Cr/setrgbcolor load def -/setcmykcolor where{ -pop -/Ck/setcmykcolor load def -}if -/Cg/setgray load def -/RE{ -findfont -dup maxlength 1 index/FontName known not{1 add}if dict begin -{ -1 index/FID ne{def}{pop pop}ifelse -}forall -/Encoding exch def -dup/FontName exch def -currentdict end definefont pop -}bind def -/DEFS 0 def -/EBEGIN{ -moveto -DEFS begin -}bind def -/EEND/end load def -/CNT 0 def -/level1 0 def -/PBEGIN{ -/level1 save def -translate -div 3 1 roll div exch scale -neg exch neg exch translate -0 setgray -0 setlinecap -1 setlinewidth -0 setlinejoin -10 setmiterlimit -[]0 setdash -/setstrokeadjust where{ -pop -false setstrokeadjust -}if -/setoverprint where{ -pop -false setoverprint -}if -newpath -/CNT countdictstack def -userdict begin -/showpage{}def -/setpagedevice{}def -}bind def -/PEND{ -countdictstack CNT sub{end}repeat -level1 restore -}bind def -end def -/setpacking where{ -pop -setpacking -}if -%%EndResource -%%EndProlog -%%BeginSetup -%%BeginFeature: *PageSize Default -<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice -%%EndFeature -%%IncludeResource: font Times-Roman -grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 -def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron -/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef -/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef -/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef -/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent -/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen -/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon -/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O -/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex -/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y -/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft -/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl -/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut -/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash -/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen -/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft -/logicalnot/minus/registered/macron/degree/plusminus/twosuperior -/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior -/ordmasculine/guilsinglright/onequarter/onehalf/threequarters -/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE -/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex -/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis -/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn -/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla -/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis -/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash -/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def -/Times-Roman@0 ENC0/Times-Roman RE -%%EndSetup -%%Page: 1 1 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<html>)0 12 Q(<head>)0 24 Q(<title>)36 36 Q -(March 10, 2009 archi)74.5 48 Q -.15(ve)-.25 G(_read_disk 3).15 E -(</title>)36 72 Q 0 Cg EP -%%Page: 2 2 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<style type="te)36 12 Q(xt/css">)-.15 E(<!--)36 -24 Q(body { mar)72 36 Q(gin-left:4%; })-.18 E(H1, H2, H3, H4, H5 {)72 48 -Q(color: maroon; padding: 4pt; mar)108 60 Q(gin-left: -4%;)-.18 E -(border: solid; border)108 72 Q(-width: thin; width: 100%;)-.2 E 0 Cg EP -%%Page: 3 3 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(background: r)108 12 Q(gb\(204,204,255\))-.18 E -(})72 24 Q(-->)36 36 Q(</style>)36 48 Q(</head>)0 60 Q -(<body bgcolor="#FFFFFF" te)0 72 Q(xt="#000000">)-.15 E 0 Cg EP -%%Page: 4 4 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<h3 id="N)36 12 Q(AME">)-.35 E -.35(NA)36 24 S -(ME).35 E(</h3>)36 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G(_read_disk_ne).15 -E(w</b>,)-.25 E(<b>archi)0 60 Q -.15(ve)-.25 G -(_read_disk_set_symlink_logical</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 -G(_read_disk_set_symlink_ph).15 E(ysical</b>,)-.05 E 0 Cg EP -%%Page: 5 5 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_read_disk_set_symlink_h).15 E(ybrid</b>,)-.05 E(<b>archi)0 24 Q -.15 -(ve)-.25 G(_read_disk_entry_from_\214le</b>,).15 E(<b>archi)0 36 Q -.15 -(ve)-.25 G(_read_disk_gname</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G -(_read_disk_uname</b>,).15 E(<b>archi)0 60 Q -.15(ve)-.25 G -(_read_disk_set_uname_lookup</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G -(_read_disk_set_gname_lookup</b>,).15 E 0 Cg EP -%%Page: 6 6 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_read_disk_set_standard_lookup</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 -G(_read_close</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G -(_read_\214nish</b>).15 E 2.5(-f)0 48 S -(unctions for reading objects from disk)-2.5 E(<h3 id="SYNOPSIS">)36 60 -Q(SYNOPSIS)36 72 Q 0 Cg EP -%%Page: 7 7 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(</h3>)36 12 Q -(<br><br><code></code><code>struct</code><code> archi)0 24 Q -.15(ve) --.25 G(</code><code> *</code>).15 E(<b>archi)0 36 Q -.15(ve)-.25 G -(_read_disk_ne).15 E(w</b>\(<code></code><code>v)-.25 E(oid</code>\))-.2 -E(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve) --.25 G -(_read_disk_set_symlink_logical</b>\(<code></code><code>struct archi).15 -E .3 -.15(ve *)-.25 H(</code>\)).15 E -(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP -%%Page: 8 8 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_read_disk_set_symlink_ph).15 E -(ysical</b>\(<code></code><code>struct archi)-.05 E .3 -.15(ve *)-.25 H -(</code>\)).15 E(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 -36 Q -.15(ve)-.25 G(_read_disk_set_symlink_h).15 E -(ybrid</b>\(<code></code><code>struct archi)-.05 E .3 -.15(ve *)-.25 H -(</code>\)).15 E(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 -60 Q -.15(ve)-.25 G -(_read_disk_gname</b>\(<code></code><code>struct archi).15 E .3 -.15 -(ve *)-.25 H(</code><code>, gid_t</code>\)).15 E -(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP -%%Page: 9 9 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_read_disk_uname</b>\(<code></code><code>struct archi).15 E .3 -.15 -(ve *)-.25 H(</code><code>, uid_t</code>\)).15 E -(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve) --.25 G(_read_disk_set_gname_lookup</b>\(<code></code>).15 E -(<code></code><code>struct archi)0 48 Q .3 -.15(ve *)-.25 H(</code>).15 -E(<code></code><code>v)0 60 Q(oid *</code>)-.2 E -(<code></code><code>const char *\(*lookup\)\(v)0 72 Q -(oid *, gid_t\)</code>)-.2 E 0 Cg EP -%%Page: 10 10 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<code></code><code>v)0 12 Q(oid \(*cleanup\)\(v) --.2 E(oid *\)</code>)-.2 E(\))0 24 Q -(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15(ve) --.25 G(_read_disk_set_uname_lookup</b>\(<code></code>).15 E -(<code></code><code>struct archi)0 60 Q .3 -.15(ve *)-.25 H(</code>).15 -E(<code></code><code>v)0 72 Q(oid *</code>)-.2 E 0 Cg EP -%%Page: 11 11 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<code></code><code>const char *\(*lookup\)\(v)0 -12 Q(oid *, uid_t\)</code>)-.2 E(<code></code><code>v)0 24 Q -(oid \(*cleanup\)\(v)-.2 E(oid *\)</code>)-.2 E(\))0 36 Q -(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve) --.25 G -(_read_disk_set_standard_lookup</b>\(<code></code><code>struct archi).15 -E .3 -.15(ve *)-.25 H(</code>\)).15 E -(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP -%%Page: 12 12 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_read_disk_entry_from_\214le</b>\(<code></code>).15 E -(<code></code><code>struct archi)0 24 Q .3 -.15(ve *)-.25 H(</code>).15 -E(<code></code><code>struct archi)0 36 Q -.15(ve)-.25 G(_entry *</code>) -.15 E(<code></code><code>int fd</code>)0 48 Q -(<code></code><code>const struct stat *</code>)0 60 Q(\))0 72 Q 0 Cg EP -%%Page: 13 13 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<br><br><code></code><code>int</code>)0 12 Q -(<b>archi)0 24 Q -.15(ve)-.25 G -(_read_close</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *) --.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0 36 Q -(<b>archi)0 48 Q -.15(ve)-.25 G -(_read_\214nish</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *) --.25 H(</code>\)).15 E(<h3 id="DESCRIPTION">)36 60 Q(DESCRIPTION)36 72 Q -0 Cg EP -%%Page: 14 14 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(</h3>)36 12 Q(These functions pro)0 24 Q -(vide an API for reading information about)-.15 E(objects on disk.)0 36 -Q(In particular)0 48 Q 2.5(,t)-.4 G(he)-2.5 E 2.5(yp)-.15 G(ro)-2.5 E -(vide an interf)-.15 E(ace for populating)-.1 E(<font size="-1"></font>\ -<font size="-1">struct</font><font size="-1"> archi)0 60 Q -.15(ve)-.25 -G(_entry</font>).15 E(objects.)0 72 Q 0 Cg EP -%%Page: 15 15 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<dl compact>)0 12 Q(<p><dt><b>archi)0 24 Q -.15 -(ve)-.25 G(_read_disk_ne).15 E(w</b>\(<code></code>\)<dd>)-.25 E -(Allocates and initializes a)0 36 Q(<font size="-1"></font><font size="\ --1">struct</font><font size="-1"> archi)0 48 Q -.15(ve)-.25 G(</font>) -.15 E(object suitable for reading object information from disk.)0 60 Q -(<p><dt>Xo<dd>)0 72 Q 0 Cg EP -%%Page: 16 16 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_read_disk_set_symlink_logical</b>\(<code></code>\),).15 E(<b>archi)0 -24 Q -.15(ve)-.25 G(_read_disk_set_symlink_ph).15 E -(ysical</b>\(<code></code>\),)-.05 E(<b>archi)0 36 Q -.15(ve)-.25 G -(_read_disk_set_symlink_h).15 E(ybrid</b>\(<code></code>\))-.05 E -(This sets the mode used for handling symbolic links.)0 48 Q(The)0 60 Q --.74(``)0 72 S(logical').74 E(')-.74 E 0 Cg EP -%%Page: 17 17 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(mode follo)0 12 Q(ws all symbolic links.)-.25 E -(The)0 24 Q -.74(``)0 36 S(ph).74 E(ysical')-.05 E(')-.74 E -(mode does not follo)0 48 Q 2.5(wa)-.25 G .3 -.15(ny s)-2.5 H -(ymbolic links.).15 E(The)0 60 Q -.74(``)0 72 S -.05(hy).74 G(brid').05 -E(')-.74 E 0 Cg EP -%%Page: 18 18 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(mode currently beha)0 12 Q -.15(ve)-.2 G 2.5(si) -.15 G(dentically to the)-2.5 E -.74(``)0 24 S(logical').74 E(')-.74 E -(mode.)0 36 Q(<p><dt>Xo<dd>)0 48 Q(<b>archi)0 60 Q -.15(ve)-.25 G -(_read_disk_gname</b>\(<code></code>\),).15 E(<b>archi)0 72 Q -.15(ve) --.25 G(_read_disk_uname</b>\(<code></code>\)).15 E 0 Cg EP -%%Page: 19 19 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(Returns a user or group name gi)0 12 Q -.15(ve) --.25 G 2.5(nag).15 G(id or uid v)-2.5 E(alue.)-.25 E(By def)0 24 Q -(ault, these al)-.1 E -.1(wa)-.1 G(ys return a NULL string.).1 E -(<p><dt>Xo<dd>)0 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G -(_read_disk_set_gname_lookup</b>\(<code></code>\),).15 E(<b>archi)0 60 Q --.15(ve)-.25 G(_read_disk_set_uname_lookup</b>\(<code></code>\)).15 E -(These allo)0 72 Q 2.5(wy)-.25 G(ou to o)-2.5 E -.15(ve)-.15 G -(rride the functions used for).15 E 0 Cg EP -%%Page: 20 20 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(user and group name lookups.)0 12 Q -1.1(Yo)0 24 -S 2.5(um)1.1 G(ay also pro)-2.5 E(vide a)-.15 E -(<font size="-1"></font><font size="-1">v)0 36 Q -(oid</font><font size="-1"> *</font>)-.2 E(pointer to a pri)0 48 Q -.25 -(va)-.25 G(te data structure and a cleanup function for).25 E -(that data.)0 60 Q(The cleanup function will be in)0 72 Q -.2(vo)-.4 G --.1(ke).2 G 2.5(dw).1 G(hen the)-2.5 E 0 Cg EP -%%Page: 21 21 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<font size="-1"></font><font size="-1">struct</\ -font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(</font>).15 E -(object is destro)0 24 Q(yed or when ne)-.1 E 2.5(wl)-.25 G -(ookup functions are re)-2.5 E(gistered.)-.15 E(<p><dt><b>archi)0 36 Q --.15(ve)-.25 G(_read_disk_set_standard_lookup</b>\(<code></code>\)<dd>) -.15 E(This con)0 48 Q -.15(ve)-.4 G -(nience function installs a standard set of user).15 E -(and group name lookup functions.)0 60 Q(These functions use)0 72 Q 0 Cg -EP -%%Page: 22 22 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -(<a href="../html3/getpwid.html">getpwid\(3\)</a>)0 12 Q(and)0 24 Q -(<a href="../html3/getgrid.html">getgrid\(3\)</a>)0 36 Q(to con)0 48 Q --.15(ve)-.4 G(rt ids to names, def).15 E -(aulting to NULL if the names cannot)-.1 E(be look)0 60 Q(ed up.)-.1 E -(These functions also implement a simple memory cache to reduce)0 72 Q 0 -Cg EP -%%Page: 23 23 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(the number of calls to)0 12 Q -(<a href="../html3/getpwid.html">getpwid\(3\)</a>)0 24 Q(and)0 36 Q -(<a href="../html3/getgrid.html">getgrid\(3\)</a>.)0 48 Q -(<p><dt><b>archi)0 60 Q -.15(ve)-.25 G -(_read_disk_entry_from_\214le</b>\(<code></code>\)<dd>).15 E -(Populates a)0 72 Q 0 Cg EP -%%Page: 24 24 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<font size="-1"></font><font size="-1">struct</\ -font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(_entry</font>).15 E -(object with information about a particular \214le.)0 24 Q(The)0 36 Q -(<font size="-1"></font><font size="-1">archi)0 48 Q -.15(ve)-.25 G -(_entry</font>).15 E(object must ha)0 60 Q .3 -.15(ve a)-.2 H -(lready been created with).15 E(<a href="../html3/archi)0 72 Q -.15(ve) --.25 G(_entry_ne).15 E -.65(w.)-.25 G(html">archi).65 E -.15(ve)-.25 G -(_entry_ne).15 E(w\(3\)</a>)-.25 E 0 Cg EP -%%Page: 25 25 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(and at least one of the source path or path \ -\214elds must already be set.)0 12 Q -(\(If both are set, the source path will be used.\))0 24 Q(<p>)36 36 Q -(Information is read from disk using the path name from the)0 48 Q(<fon\ -t size="-1"></font><font size="-1">struct</font><font size="-1"> archi)0 -60 Q -.15(ve)-.25 G(_entry</font>).15 E(object.)0 72 Q 0 Cg EP -%%Page: 26 26 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(If a \214le descriptor is pro)0 12 Q -(vided, some information will be obtained using)-.15 E -(that \214le descriptor)0 24 Q 2.5(,o)-.4 G 2.5(np)-2.5 G -(latforms that support the appropriate)-2.5 E(system calls.)0 36 Q(<p>) -36 48 Q(If a pointer to a)0 60 Q(<font size="-1"></font><font size="-1"\ ->struct</font><font size="-1"> stat</font>)0 72 Q 0 Cg EP -%%Page: 27 27 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(is pro)0 12 Q -(vided, information from that structure will be used instead)-.15 E -(of reading from the disk where appropriate.)0 24 Q(This can pro)0 36 Q -(vide performance bene\214ts in scenarios where)-.15 E(<font size="-1">\ -</font><font size="-1">struct</font><font size="-1"> stat</font>)0 48 Q -(information has already been read from the disk as a side ef)0 60 Q -(fect)-.25 E(of some other operation.)0 72 Q 0 Cg EP -%%Page: 28 28 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(\(F)0 12 Q(or e)-.15 E(xample, directory tra) --.15 E -.15(ve)-.2 G(rsal libraries often pro).15 E -(vide this information.\))-.15 E(<p>)36 24 Q(Where necessary)0 36 Q 2.5 -(,u)-.65 G(ser and group ids are con)-2.5 E -.15(ve)-.4 G -(rted to user and group names).15 E(using the currently re)0 48 Q -(gistered lookup functions abo)-.15 E -.15(ve)-.15 G(.).15 E(This af)0 -60 Q(fects the \214le o)-.25 E(wnership \214elds and A)-.25 E(CL v)-.4 E -(alues in the)-.25 E(<font size="-1"></font><font size="-1">struct</fon\ -t><font size="-1"> archi)0 72 Q -.15(ve)-.25 G(_entry</font>).15 E 0 Cg -EP -%%Page: 29 29 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(object.)0 12 Q(<p><dt><b>archi)0 24 Q -.15(ve) --.25 G(_read_close</b>\(<code></code>\)<dd>).15 E -(This currently does nothing.)0 36 Q(<p><dt><b>archi)0 48 Q -.15(ve)-.25 -G(_write_\214nish</b>\(<code></code>\)<dd>).15 E(In)0 60 Q -.2(vo)-.4 G --.1(ke).2 G(s).1 E(<b>archi)0 72 Q -.15(ve)-.25 G -(_write_close</b>\(<code></code>\)).15 E 0 Cg EP -%%Page: 30 30 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(if it w)0 12 Q(as not in)-.1 E -.2(vo)-.4 G -.1 -(ke).2 G 2.5(dm).1 G(anually)-2.5 E 2.5(,t)-.65 G -(hen releases all resources.)-2.5 E(</dl>)0 24 Q -(More information about the)0 36 Q(<i></i><i>struct</i><i> archi)0 48 Q --.15(ve)-.25 G(</i>).15 E(object and the o)0 60 Q -.15(ve)-.15 G -(rall design of the library can be found in the).15 E -(<a href="../html3/libarchi)0 72 Q -.15(ve)-.25 G(.html">libarchi).15 E --.15(ve)-.25 G(\(3\)</a>).15 E 0 Cg EP -%%Page: 31 31 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -.15(ove)0 12 S(rvie).15 E -.65(w.)-.25 G -(<h3 id="EXAMPLE">)36 24 Q(EXAMPLE)36 36 Q(</h3>)36 48 Q(The follo)0 60 -Q(wing illustrates basic usage of the library by)-.25 E(sho)0 72 Q -(wing ho)-.25 E 2.5(wt)-.25 G 2.5(ou)-2.5 G(se it to cop)-2.5 E 2.5(ya) --.1 G 2.5(ni)-2.5 G(tem on disk into an archi)-2.5 E -.15(ve)-.25 G(.) -.15 E 0 Cg EP -%%Page: 32 32 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<dl compact><dt><dd>)0 12 Q(<code>)0 24 Q(<pre>) -0 36 Q -.2(vo)0 48 S(id).2 E(\214le_to_archi)0 60 Q -.15(ve)-.25 G -(\(struct archi).15 E .3 -.15(ve *)-.25 H(a, const char *name\)).15 E({) -0 72 Q 0 Cg EP -%%Page: 33 33 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(char b)5 12 Q(uf)-.2 E(f[8192];)-.25 E -(size_t bytes_read;)5 24 Q(struct archi)5 36 Q .3 -.15(ve *)-.25 H(ard;) -.15 E(struct archi)5 48 Q -.15(ve)-.25 G(_entry *entry;).15 E(int fd;)5 -60 Q(<p>)36 72 Q 0 Cg EP -%%Page: 34 34 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(ard = archi)5 12 Q -.15(ve)-.25 G(_read_disk_ne) -.15 E(w\(\);)-.25 E(archi)5 24 Q -.15(ve)-.25 G -(_read_disk_set_standard_lookup\(ard\);).15 E(entry = archi)5 36 Q -.15 -(ve)-.25 G(_entry_ne).15 E(w\(\);)-.25 E(fd = open\(name, O_RDONL)5 48 Q -(Y\);)-1 E(if \(fd < 0\))5 60 Q(return;)12.5 72 Q 0 Cg EP -%%Page: 35 35 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(archi)5 12 Q -.15(ve)-.25 G(_entry_cop).15 E -(y_sourcepath\(entry)-.1 E 2.5(,n)-.65 G(ame\);)-2.5 E(archi)5 24 Q -.15 -(ve)-.25 G(_read_disk_entry_from_\214le\(ard, entry).15 E 2.5(,f)-.65 G -(d, NULL\);)-2.5 E(archi)5 36 Q -.15(ve)-.25 G -(_write_header\(a, entry\);).15 E(while \(\(bytes_read = read\(fd, b)5 -48 Q(uf)-.2 E(f, sizeof\(b)-.25 E(uf)-.2 E(f\)\)\) > 0\))-.25 E(archi)10 -60 Q -.15(ve)-.25 G(_write_data\(a, b).15 E(uf)-.2 E(f, bytes_read\);) --.25 E(archi)5 72 Q -.15(ve)-.25 G(_write_\214nish_entry\(a\);).15 E 0 -Cg EP -%%Page: 36 36 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(archi)5 12 Q -.15(ve)-.25 G -(_read_\214nish\(ard\);).15 E(archi)5 24 Q -.15(ve)-.25 G -(_entry_free\(entry\);).15 E(})0 36 Q(</pre>)0 48 Q(</code>)0 60 Q -(</dl>)0 72 Q 0 Cg EP -%%Page: 37 37 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<h3 id="RETURN V)36 12 Q(ALUES">)-1.35 E -(RETURN V)36 24 Q(ALUES)-1.35 E(</h3>)36 36 Q(Most functions return)0 48 -Q(<b></b><b>ARCHIVE_OK</b>)0 60 Q(\(zero\) on success, or one of se)0 72 -Q -.15(ve)-.25 G(ral ne).15 E -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 0 -Cg EP -%%Page: 38 38 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(error codes for errors.)0 12 Q -(Speci\214c error codes include:)0 24 Q(<b></b><b>ARCHIVE_RETR)0 36 Q -(Y</b>)-.65 E(for operations that might succeed if retried,)0 48 Q -(<b></b><b>ARCHIVE_W)0 60 Q(ARN</b>)-1.2 E -(for unusual conditions that do not pre)0 72 Q -.15(ve)-.25 G -(nt further operations, and).15 E 0 Cg EP -%%Page: 39 39 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b></b><b>ARCHIVE_F)0 12 Q -1.21 -1.11(AT A)-.74 -H(L</b>)1.11 E(for serious errors that mak)0 24 Q 2.5(er)-.1 G -(emaining operations impossible.)-2.5 E(The)0 36 Q -(<a href="../html3/archi)0 48 Q -.15(ve)-.25 G(_errno.html">archi).15 E --.15(ve)-.25 G(_errno\(3\)</a>).15 E(and)0 60 Q(<a href="../html3/archi) -0 72 Q -.15(ve)-.25 G(_error_string.html">archi).15 E -.15(ve)-.25 G -(_error_string\(3\)</a>).15 E 0 Cg EP -%%Page: 40 40 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(functions can be used to retrie)0 12 Q .3 -.15 -(ve a)-.25 H 2.5(na).15 G(ppropriate error code and a)-2.5 E(te)0 24 Q -(xtual error message.)-.15 E(\(See)0 36 Q(<a href="../html3/archi)0 48 Q --.15(ve)-.25 G(_util.html">archi).15 E -.15(ve)-.25 G(_util\(3\)</a>).15 -E(for details.\))0 60 Q(<p>)36 72 Q 0 Cg EP -%%Page: 41 41 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G(_read_disk_ne).15 -E(w</b>\(<code></code>\))-.25 E(returns a pointer to a ne)0 24 Q -(wly-allocated)-.25 E(<font size="-1"></font><font size="-1">struct</fo\ -nt><font size="-1"> archi)0 36 Q -.15(ve)-.25 G(</font>).15 E -(object or NULL if the allocation f)0 48 Q(ailed for an)-.1 E 2.5(yr) --.15 G(eason.)-2.5 E(<p>)36 60 Q(<b>archi)0 72 Q -.15(ve)-.25 G -(_read_disk_gname</b>\(<code></code>\)).15 E 0 Cg EP -%%Page: 42 42 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(and)0 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G -(_read_disk_uname</b>\(<code></code>\)).15 E(return)0 36 Q(<font size="\ --1"></font><font size="-1">const</font><font size="-1"> char</font><fon\ -t size="-1"> *</font>)0 48 Q(pointers to the te)0 60 Q -(xtual name or NULL if the lookup f)-.15 E(ailed for an)-.1 E 2.5(yr) --.15 G(eason.)-2.5 E -(The returned pointer points to internal storage that)0 72 Q 0 Cg EP -%%Page: 43 43 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(may be reused on the ne)0 12 Q -(xt call to either of these functions;)-.15 E(callers should cop)0 24 Q -2.5(yt)-.1 G(he string if the)-2.5 E 2.5(yn)-.15 G -(eed to continue accessing it.)-2.5 E(<p>)36 36 Q(<h3 id="SEE ALSO">)36 -48 Q(SEE ALSO)36 60 Q(</h3>)36 72 Q 0 Cg EP -%%Page: 44 44 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<a href="../html3/archi)0 12 Q -.15(ve)-.25 G -(_read.html">archi).15 E -.15(ve)-.25 G(_read\(3\)</a>,).15 E -(<a href="../html3/archi)0 24 Q -.15(ve)-.25 G(_write.html">archi).15 E --.15(ve)-.25 G(_write\(3\)</a>,).15 E(<a href="../html3/archi)0 36 Q --.15(ve)-.25 G(_write_disk.html">archi).15 E -.15(ve)-.25 G -(_write_disk\(3\)</a>,).15 E(<a href="../html1/tar)0 48 Q -(.html">tar\(1\)</a>,)-.55 E(<a href="../html3/libarchi)0 60 Q -.15(ve) --.25 G(.html">libarchi).15 E -.15(ve)-.25 G(\(3\)</a>).15 E -(<h3 id="HIST)36 72 Q(OR)-.18 E(Y">)-.65 E 0 Cg EP -%%Page: 45 45 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(HIST)36 12 Q(OR)-.18 E(Y)-.65 E(</h3>)36 24 Q -(The)0 36 Q(<b>libarchi)0 48 Q -.15(ve)-.25 G(</b>).15 E -(library \214rst appeared in)0 60 Q(FreeBSD5.3.)0 72 Q 0 Cg EP -%%Page: 46 46 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(The)0 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G -(_read_disk</b>).15 E(interf)0 36 Q(ace w)-.1 E(as added to)-.1 E -(<b>libarchi)0 48 Q -.15(ve)-.25 G(</b><b>2.6</b>).15 E -(and \214rst appeared in)0 60 Q(FreeBSD8.0.)0 72 Q 0 Cg EP -%%Page: 47 47 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<h3 id="A)36 12 Q(UTHORS">)-.55 E -.55(AU)36 24 -S(THORS).55 E(</h3>)36 36 Q(<p>)36 48 Q(The)0 60 Q(<b>libarchi)0 72 Q --.15(ve)-.25 G(</b>).15 E 0 Cg EP -%%Page: 48 48 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(library w)0 12 Q(as written by)-.1 E -.35(Ti)0 -24 S 2.5(mK).35 G(ientzle <kientzle@freebsd.or)-2.5 E(g>.)-.18 E -(<h3 id="B)36 36 Q(UGS">)-.1 E -.1(BU)36 48 S(GS).1 E(</h3>)36 60 Q(The) -0 72 Q 0 Cg EP -%%Page: 49 49 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -.74(``)0 12 S(standard').74 E(')-.74 E -(user name and group name lookup functions are not the def)0 24 Q -(aults because)-.1 E(<a href="../html3/getgrid.html">getgrid\(3\)</a>)0 -36 Q(and)0 48 Q(<a href="../html3/getpwid.html">getpwid\(3\)</a>)0 60 Q -(are sometimes too lar)0 72 Q(ge for particular applications.)-.18 E 0 -Cg EP -%%Page: 50 50 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(The current design allo)0 12 Q -(ws the application author to use a more)-.25 E -(compact implementation when appropriate.)0 24 Q(<p>)36 36 Q -(The full list of metadata read from disk by)0 48 Q(<b>archi)0 60 Q -.15 -(ve)-.25 G(_read_disk_entry_from_\214le</b>\(<code></code>\)).15 E -(is necessarily system-dependent.)0 72 Q 0 Cg EP -%%Page: 51 51 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<p>)36 12 Q(The)0 24 Q(<b>archi)0 36 Q -.15(ve) --.25 G(_read_disk_entry_from_\214le</b>\(<code></code>\)).15 E -(function reads as much information as it can from disk.)0 48 Q -(Some method should be pro)0 60 Q -(vided to limit this so that clients who)-.15 E(do not need A)0 72 Q -(CLs, for instance, can a)-.4 E -.2(vo)-.2 G(id the e).2 E(xtra w)-.15 E -(ork needed)-.1 E 0 Cg EP -%%Page: 52 52 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(to look up such information.)0 12 Q(<p>)36 24 Q -(This API should pro)0 36 Q(vide a set of methods for w)-.15 E -(alking a directory tree.)-.1 E(That w)0 48 Q(ould mak)-.1 E 2.5(ei)-.1 -G 2.5(tad)-2.5 G(irect parallel of the)-2.5 E(<a href="../html3/archi)0 -60 Q -.15(ve)-.25 G(_read.html">archi).15 E -.15(ve)-.25 G -(_read\(3\)</a>).15 E(API.)0 72 Q 0 Cg EP -%%Page: 53 53 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(When such methods are implemented, the)0 12 Q --.74(``)0 24 S -.05(hy).74 G(brid').05 E(')-.74 E -(symbolic link mode will mak)0 36 Q 2.5(es)-.1 G(ense.)-2.5 E(</body>)0 -48 Q(</html>)0 60 Q 0 Cg EP -%%Trailer -end -%%EOF +<!-- Creator : groff version 1.19.2 --> +<!-- CreationDate: Sun Mar 14 19:50:19 2010 --> +<!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; } + pre { margin-top: 0; margin-bottom: 0; } + table { margin-top: 0; margin-bottom: 0; } +</style> +<title></title> +</head> +<body> + +<hr> + + +<p valign="top">archive_read_disk(3) FreeBSD Library +Functions Manual archive_read_disk(3)</p> + +<p style="margin-top: 1em" valign="top"><b>NAME</b></p> + +<p style="margin-left:8%;"><b>archive_read_disk_new</b>, +<b>archive_read_disk_set_symlink_logical</b>, +<b>archive_read_disk_set_symlink_physical</b>, +<b>archive_read_disk_set_symlink_hybrid</b>, +<b>archive_read_disk_entry_from_file</b>, +<b>archive_read_disk_gname</b>, +<b>archive_read_disk_uname</b>, +<b>archive_read_disk_set_uname_lookup</b>, +<b>archive_read_disk_set_gname_lookup</b>, +<b>archive_read_disk_set_standard_lookup</b>, +<b>archive_read_close</b>, <b>archive_read_finish</b> +— functions for reading objects from disk</p> + + +<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p> + +<p style="margin-left:8%;"><b>#include +<archive.h></b></p> + +<p style="margin-left:8%; margin-top: 1em"><i>struct +archive *</i></p> + + +<p style="margin-left:14%;"><b>archive_read_disk_new</b>(<i>void</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:14%;"><b>archive_read_disk_set_symlink_logical</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:14%;"><b>archive_read_disk_set_symlink_physical</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:14%;"><b>archive_read_disk_set_symlink_hybrid</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:14%;"><b>archive_read_disk_gname</b>(<i>struct archive *</i>, +<i>gid_t</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:14%;"><b>archive_read_disk_uname</b>(<i>struct archive *</i>, +<i>uid_t</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p valign="top"><b>archive_read_disk_set_gname_lookup</b>(<i>struct archive *</i>, +<i>void *</i>, +<i>const char *(*lookup)(void *, gid_t)</i>, +<i>void (*cleanup)(void *)</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p valign="top"><b>archive_read_disk_set_uname_lookup</b>(<i>struct archive *</i>, +<i>void *</i>, +<i>const char *(*lookup)(void *, uid_t)</i>, +<i>void (*cleanup)(void *)</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:14%;"><b>archive_read_disk_set_standard_lookup</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p valign="top"><b>archive_read_disk_entry_from_file</b>(<i>struct archive *</i>, +<i>struct archive_entry *</i>, <i>int fd</i>, +<i>const struct stat *</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:14%;"><b>archive_read_close</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:8%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:14%;"><b>archive_read_finish</b>(<i>struct archive *</i>);</p> + + +<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p> + +<p style="margin-left:8%;">These functions provide an API +for reading information about objects on disk. In +particular, they provide an interface for populating struct +archive_entry objects.</p> + + +<p style="margin-top: 1em" valign="top"><b>archive_read_disk_new</b>()</p> + +<p style="margin-left:20%;">Allocates and initializes a +struct archive object suitable for reading object +information from disk.</p> + + +<p style="margin-top: 1em" valign="top"><b>archive_read_disk_set_symlink_logical</b>(), +<b>archive_read_disk_set_symlink_physical</b>(), +<b>archive_read_disk_set_symlink_hybrid</b>()</p> + +<p style="margin-left:20%;">This sets the mode used for +handling symbolic links. The +‘‘logical’’ mode follows all +symbolic links. The ‘‘physical’’ +mode does not follow any symbolic links. The +‘‘hybrid’’ mode currently behaves +identically to the ‘‘logical’’ +mode.</p> + + +<p style="margin-top: 1em" valign="top"><b>archive_read_disk_gname</b>(), +<b>archive_read_disk_uname</b>()</p> + +<p style="margin-left:20%;">Returns a user or group name +given a gid or uid value. By default, these always return a +NULL string.</p> + + +<p style="margin-top: 1em" valign="top"><b>archive_read_disk_set_gname_lookup</b>(), +<b>archive_read_disk_set_uname_lookup</b>()</p> + +<p style="margin-left:20%;">These allow you to override the +functions used for user and group name lookups. You may also +provide a void * pointer to a private data structure and a +cleanup function for that data. The cleanup function will be +invoked when the struct archive object is destroyed or when +new lookup functions are registered.</p> + + +<p style="margin-top: 1em" valign="top"><b>archive_read_disk_set_standard_lookup</b>()</p> + +<p style="margin-left:20%;">This convenience function +installs a standard set of user and group name lookup +functions. These functions use getpwid(3) and getgrid(3) to +convert ids to names, defaulting to NULL if the names cannot +be looked up. These functions also implement a simple memory +cache to reduce the number of calls to getpwid(3) and +getgrid(3).</p> + + +<p style="margin-top: 1em" valign="top"><b>archive_read_disk_entry_from_file</b>()</p> + +<p style="margin-left:20%;">Populates a struct +archive_entry object with information about a particular +file. The archive_entry object must have already been +created with archive_entry_new(3) and at least one of the +source path or path fields must already be set. (If both are +set, the source path will be used.)</p> + +<p style="margin-left:20%; margin-top: 1em">Information is +read from disk using the path name from the struct +archive_entry object. If a file descriptor is provided, some +information will be obtained using that file descriptor, on +platforms that support the appropriate system calls.</p> + +<p style="margin-left:20%; margin-top: 1em">If a pointer to +a struct stat is provided, information from that structure +will be used instead of reading from the disk where +appropriate. This can provide performance benefits in +scenarios where struct stat information has already been +read from the disk as a side effect of some other operation. +(For example, directory traversal libraries often provide +this information.)</p> + +<p style="margin-left:20%; margin-top: 1em">Where +necessary, user and group ids are converted to user and +group names using the currently registered lookup functions +above. This affects the file ownership fields and ACL values +in the struct archive_entry object.</p> + + +<p style="margin-top: 1em" valign="top"><b>archive_read_close</b>()</p> + +<p style="margin-left:20%;">This currently does +nothing.</p> + + +<p style="margin-top: 1em" valign="top"><b>archive_write_finish</b>()</p> + +<p style="margin-left:20%;">Invokes +<b>archive_write_close</b>() if it was not invoked manually, +then releases all resources.</p> + +<p style="margin-left:8%;">More information about the +<i>struct archive</i> object and the overall design of the +library can be found in the libarchive(3) overview.</p> + +<p style="margin-top: 1em" valign="top"><b>EXAMPLE</b></p> + +<p style="margin-left:8%;">The following illustrates basic +usage of the library by showing how to use it to copy an +item on disk into an archive.</p> + +<p style="margin-left:17%; margin-top: 1em">void <br> +file_to_archive(struct archive *a, const char *name) <br> +{ <br> +char buff[8192]; <br> +size_t bytes_read; <br> +struct archive *ard; <br> +struct archive_entry *entry; <br> +int fd;</p> + +<p style="margin-left:17%; margin-top: 1em">ard = +archive_read_disk_new(); <br> +archive_read_disk_set_standard_lookup(ard); <br> +entry = archive_entry_new(); <br> +fd = open(name, O_RDONLY); <br> +if (fd < 0) <br> +return; <br> +archive_entry_copy_sourcepath(entry, name); <br> +archive_read_disk_entry_from_file(ard, entry, fd, NULL); +<br> +archive_write_header(a, entry); <br> +while ((bytes_read = read(fd, buff, sizeof(buff))) > 0) +<br> +archive_write_data(a, buff, bytes_read); <br> +archive_write_finish_entry(a); <br> +archive_read_finish(ard); <br> +archive_entry_free(entry); <br> +}</p> + +<p style="margin-top: 1em" valign="top"><b>RETURN +VALUES</b></p> + +<p style="margin-left:8%;">Most functions return +<b>ARCHIVE_OK</b> (zero) on success, or one of several +negative error codes for errors. Specific error codes +include: <b>ARCHIVE_RETRY</b> for operations that might +succeed if retried, <b>ARCHIVE_WARN</b> for unusual +conditions that do not prevent further operations, and +<b>ARCHIVE_FATAL</b> for serious errors that make remaining +operations impossible. The archive_errno(3) and +archive_error_string(3) functions can be used to retrieve an +appropriate error code and a textual error message. (See +archive_util(3) for details.)</p> + + +<p style="margin-left:8%; margin-top: 1em"><b>archive_read_disk_new</b>() +returns a pointer to a newly-allocated struct archive object +or NULL if the allocation failed for any reason.</p> + + +<p style="margin-left:8%; margin-top: 1em"><b>archive_read_disk_gname</b>() +and <b>archive_read_disk_uname</b>() return const char * +pointers to the textual name or NULL if the lookup failed +for any reason. The returned pointer points to internal +storage that may be reused on the next call to either of +these functions; callers should copy the string if they need +to continue accessing it.</p> + +<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p> + +<p style="margin-left:8%;">archive_read(3), +archive_write(3), archive_write_disk(3), tar(1), +libarchive(3)</p> + +<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p> + +<p style="margin-left:8%;">The <b>libarchive</b> library +first appeared in FreeBSD 5.3. The +<b>archive_read_disk</b> interface was added to +<b>libarchive 2.6</b> and first appeared in +FreeBSD 8.0.</p> + +<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p> + +<p style="margin-left:8%;">The <b>libarchive</b> library +was written by Tim Kientzle +⟨kientzle@freebsd.org⟩.</p> + +<p style="margin-top: 1em" valign="top"><b>BUGS</b></p> + +<p style="margin-left:8%;">The +‘‘standard’’ user name and group +name lookup functions are not the defaults because +getgrid(3) and getpwid(3) are sometimes too large for +particular applications. The current design allows the +application author to use a more compact implementation when +appropriate.</p> + +<p style="margin-left:8%; margin-top: 1em">The full list of +metadata read from disk by +<b>archive_read_disk_entry_from_file</b>() is necessarily +system-dependent.</p> + +<p style="margin-left:8%; margin-top: 1em">The +<b>archive_read_disk_entry_from_file</b>() function reads as +much information as it can from disk. Some method should be +provided to limit this so that clients who do not need ACLs, +for instance, can avoid the extra work needed to look up +such information.</p> + +<p style="margin-left:8%; margin-top: 1em">This API should +provide a set of methods for walking a directory tree. That +would make it a direct parallel of the archive_read(3) API. +When such methods are implemented, the +‘‘hybrid’’ symbolic link mode will +make sense.</p> + + +<p style="margin-left:8%; margin-top: 1em">FreeBSD 9.0 +March 10, 2009 FreeBSD 9.0</p> +<hr> +</body> +</html> |