diff options
author | joerg <joerg@pkgsrc.org> | 2016-06-20 17:11:11 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2016-06-20 17:11:11 +0000 |
commit | f67a2b170587775e96627a49fc615267312586d3 (patch) | |
tree | 02c059d4e8b4d0cd6c197e12c85e780cf7cfdc26 /archivers/libarchive/files/doc/html/archive_write_disk.3.html | |
parent | 87546b4ede6db5d7ce4cc1156faa7166273805b3 (diff) | |
download | pkgsrc-f67a2b170587775e96627a49fc615267312586d3.tar.gz |
Import libarchive-3.2.1:
- security fixes and other bugfixes
- support for multhreading in xz 5.2+
Diffstat (limited to 'archivers/libarchive/files/doc/html/archive_write_disk.3.html')
-rw-r--r-- | archivers/libarchive/files/doc/html/archive_write_disk.3.html | 1361 |
1 files changed, 469 insertions, 892 deletions
diff --git a/archivers/libarchive/files/doc/html/archive_write_disk.3.html b/archivers/libarchive/files/doc/html/archive_write_disk.3.html index 1d3ca7bbf92..0e976b467c5 100644 --- a/archivers/libarchive/files/doc/html/archive_write_disk.3.html +++ b/archivers/libarchive/files/doc/html/archive_write_disk.3.html @@ -1,892 +1,469 @@ -%!PS-Adobe-3.0 -%%Creator: groff version 1.19.2 -%%CreationDate: Wed Jun 30 11:55:52 2010 -%%DocumentNeededResources: font Times-Roman -%%DocumentSuppliedResources: procset grops 1.19 2 -%%Pages: 63 -%%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 -(August 5, 2008 archi)74.5 48 Q -.15(ve)-.25 G(_write_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(_write_disk_ne) -.15 E(w</b>,)-.25 E(<b>archi)0 60 Q -.15(ve)-.25 G -(_write_disk_set_options</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G -(_write_disk_set_skip_\214le</b>,).15 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 -(_write_disk_set_group_lookup</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G -(_write_disk_set_standard_lookup</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 -G(_write_disk_set_user_lookup</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G -(_write_header</b>,).15 E(<b>archi)0 60 Q -.15(ve)-.25 G -(_write_data</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G -(_write_\214nish_entry</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 -(_write_close</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G -(_write_\214nish</b>).15 E 2.5(-f)0 36 S -(unctions for creating objects on disk)-2.5 E(<h3 id="SYNOPSIS">)36 48 Q -(SYNOPSIS)36 60 Q(</h3>)36 72 Q 0 Cg EP -%%Page: 7 7 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -(<br><br><code></code><code>struct</code><code> archi)0 12 Q -.15(ve) --.25 G(</code><code> *</code>).15 E(<b>archi)0 24 Q -.15(ve)-.25 G -(_write_disk_ne).15 E(w</b>\(<code></code><code>v)-.25 E(oid</code>\)) --.2 E(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15 -(ve)-.25 G(_write_disk_set_options</b>\(<code></code><code>struct archi) -.15 E .3 -.15(ve *)-.25 H(</code><code>, int \215ags</code>\)).15 E -(<br><br><code></code><code>int</code>)0 60 Q(<b>archi)0 72 Q -.15(ve) --.25 G(_write_disk_set_skip_\214le</b>\(<code></code><code>struct archi) -.15 E .3 -.15(ve *)-.25 H(</code><code>, de).15 E -(v_t</code><code>, ino_t</code>\))-.25 E 0 Cg EP -%%Page: 8 8 -%%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 -(_write_disk_set_group_lookup</b>\(<code></code>).15 E -(<code></code><code>struct archi)0 36 Q .3 -.15(ve *)-.25 H(</code>).15 -E(<code></code><code>v)0 48 Q(oid *</code>)-.2 E -(<code></code>gid_t \(*\)\(v)0 60 Q -(oid *, const char *gname, gid_t gid\))-.2 E(<code></code><code>v)0 72 Q -(oid \(*cleanup\)\(v)-.2 E(oid *\)</code>)-.2 E 0 Cg EP -%%Page: 9 9 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(\))0 12 Q(<br><br><code></code><code>int</code>) -0 24 Q(<b>archi)0 36 Q -.15(ve)-.25 G -(_write_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 48 Q(<b>archi)0 60 Q -.15(ve) --.25 G(_write_disk_set_user_lookup</b>\(<code></code>).15 E -(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15 -E 0 Cg EP -%%Page: 10 10 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<code></code><code>v)0 12 Q(oid *</code>)-.2 E -(<code></code>uid_t \(*\)\(v)0 24 Q -(oid *, const char *uname, uid_t uid\))-.2 E(<code></code><code>v)0 36 Q -(oid \(*cleanup\)\(v)-.2 E(oid *\)</code>)-.2 E(\))0 48 Q -(<br><br><code></code><code>int</code>)0 60 Q(<b>archi)0 72 Q -.15(ve) --.25 G(_write_header</b>\(<code></code><code>struct archi).15 E .3 -.15 -(ve *)-.25 H(</code><code>, struct archi).15 E -.15(ve)-.25 G -(_entry *</code>\)).15 E 0 Cg EP -%%Page: 11 11 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<br><br><code></code><code>ssize_t</code>)0 12 Q -(<b>archi)0 24 Q -.15(ve)-.25 G -(_write_data</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *) --.25 H(</code><code>, const v).15 E(oid *</code><code>, size_t</code>\)) --.2 E(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15 -(ve)-.25 G(_write_\214nish_entry</b>\(<code></code><code>struct archi) -.15 E .3 -.15(ve *)-.25 H(</code>\)).15 E -(<br><br><code></code><code>int</code>)0 60 Q(<b>archi)0 72 Q -.15(ve) --.25 G(_write_close</b>\(<code></code><code>struct archi).15 E .3 -.15 -(ve *)-.25 H(</code>\)).15 E 0 Cg EP -%%Page: 12 12 -%%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 -(_write_\214nish</b>\(<code></code><code>struct archi).15 E .3 -.15 -(ve *)-.25 H(</code>\)).15 E(<h3 id="DESCRIPTION">)36 36 Q(DESCRIPTION) -36 48 Q(</h3>)36 60 Q(These functions pro)0 72 Q -(vide a complete API for creating objects on)-.15 E 0 Cg EP -%%Page: 13 13 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(disk from)0 12 Q(<font size="-1"></font><font s\ -ize="-1">struct</font><font size="-1"> archi)0 24 Q -.15(ve)-.25 G -(_entry</font>).15 E(descriptions.)0 36 Q(The)0 48 Q 2.5(ya)-.15 G -(re most naturally used when e)-2.5 E(xtracting objects from an archi) --.15 E -.15(ve)-.25 G(using the)0 60 Q(<b>archi)0 72 Q -.15(ve)-.25 G -(_read</b>\(<code></code>\)).15 E 0 Cg EP -%%Page: 14 14 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(interf)0 12 Q(ace.)-.1 E -(The general process is to read)0 24 Q(<font size="-1"></font><font siz\ -e="-1">struct</font><font size="-1"> archi)0 36 Q -.15(ve)-.25 G -(_entry</font>).15 E(objects from an archi)0 48 Q -.15(ve)-.25 G 2.5(,t) -.15 G(hen write those objects to a)-2.5 E(<font size="-1"></font><font \ -size="-1">struct</font><font size="-1"> archi)0 60 Q -.15(ve)-.25 G -(</font>).15 E(object created using the)0 72 Q 0 Cg EP -%%Page: 15 15 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_write_disk</b>\(<code></code>\)).15 E -.1(fa)0 24 S(mily functions.).1 -E(This interf)0 36 Q(ace is deliberately v)-.1 E(ery similar to the)-.15 -E(<b>archi)0 48 Q -.15(ve)-.25 G(_write</b>\(<code></code>\)).15 E -(interf)0 60 Q(ace used to write objects to a streaming archi)-.1 E -.15 -(ve)-.25 G(.).15 E(<dl compact>)0 72 Q 0 Cg EP -%%Page: 16 16 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G -(_write_disk_ne).15 E(w</b>\(<code></code>\)<dd>)-.25 E -(Allocates and initializes a)0 24 Q(<font size="-1"></font><font size="\ --1">struct</font><font size="-1"> archi)0 36 Q -.15(ve)-.25 G(</font>) -.15 E(object suitable for writing objects to disk.)0 48 Q -(<p><dt><b>archi)0 60 Q -.15(ve)-.25 G -(_write_disk_set_skip_\214le</b>\(<code></code>\)<dd>).15 E -(Records the de)0 72 Q -(vice and inode numbers of a \214le that should not be)-.25 E 0 Cg EP -%%Page: 17 17 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -.15(ove)0 12 S(rwritten.).15 E -(This is typically used to ensure that an e)0 24 Q -(xtraction process does not)-.15 E -.15(ove)0 36 S(rwrite the archi).15 -E .3 -.15(ve f)-.25 H(rom which objects are being read.).15 E -(This capability is technically unnecessary b)0 48 Q -(ut can be a signi\214cant)-.2 E(performance optimization in practice.)0 -60 Q(<p><dt><b>archi)0 72 Q -.15(ve)-.25 G -(_write_disk_set_options</b>\(<code></code>\)<dd>).15 E 0 Cg EP -%%Page: 18 18 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -(The options \214eld consists of a bitwise OR of one or more of the)0 12 -Q(follo)0 24 Q(wing v)-.25 E(alues:)-.25 E(<dl compact>)0 36 Q -(<dt><b></b><b>ARCHIVE_EXTRA)0 48 Q(CT_O)-.4 E(WNER</b><dd>)-.35 E -(The user and group IDs should be set on the restored \214le.)0 60 Q -(By def)0 72 Q(ault, the user and group IDs are not restored.)-.1 E 0 Cg -EP -%%Page: 19 19 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<dt><b></b><b>ARCHIVE_EXTRA)0 12 Q -(CT_PERM</b><dd>)-.4 E -(Full permissions \(including SGID, SUID, and stick)0 24 Q 2.5(yb)-.15 G -(its\) should)-2.5 E(be restored e)0 36 Q -(xactly as speci\214ed, without obe)-.15 E(ying the)-.15 E -(current umask.)0 48 Q -(Note that SUID and SGID bits can only be restored if the)0 60 Q -(user and group ID of the object on disk are correct.)0 72 Q 0 Cg EP -%%Page: 20 20 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(If)0 12 Q(<b></b><b>ARCHIVE_EXTRA)0 24 Q(CT_O) --.4 E(WNER</b>)-.35 E -(is not speci\214ed, then SUID and SGID bits will only be restored)0 36 -Q(if the def)0 48 Q(ault user and group IDs of ne)-.1 E -(wly-created objects on disk)-.25 E -(happen to match those speci\214ed in the archi)0 60 Q .3 -.15(ve e)-.25 -H(ntry).15 E(.)-.65 E(By def)0 72 Q -(ault, only basic permissions are restored, and umask is obe)-.1 E(yed.) --.15 E 0 Cg EP -%%Page: 21 21 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<dt><b></b><b>ARCHIVE_EXTRA)0 12 Q -(CT_TIME</b><dd>)-.4 E -(The timestamps \(mtime, ctime, and atime\) should be restored.)0 24 Q -(By def)0 36 Q(ault, the)-.1 E 2.5(ya)-.15 G(re ignored.)-2.5 E -(Note that restoring of atime is not currently supported.)0 48 Q -(<dt><b></b><b>ARCHIVE_EXTRA)0 60 Q(CT_NO_O)-.4 E(VER)-.5 E -(WRITE</b><dd>)-.55 E(Existing \214les on disk will not be o)0 72 Q -.15 -(ve)-.15 G(rwritten.).15 E 0 Cg EP -%%Page: 22 22 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(By def)0 12 Q(ault, e)-.1 E(xisting re)-.15 E -(gular \214les are truncated and o)-.15 E -.15(ve)-.15 G(rwritten;).15 E --.15(ex)0 24 S(isting directories will ha).15 E .3 -.15(ve t)-.2 H -(heir permissions updated;).15 E(other pre-e)0 36 Q -(xisting objects are unlink)-.15 E(ed and recreated from scratch.)-.1 E -(<dt><b></b><b>ARCHIVE_EXTRA)0 48 Q(CT_UNLINK</b><dd>)-.4 E -(Existing \214les on disk will be unlink)0 60 Q(ed before an)-.1 E 2.5 -(ya)-.15 G(ttempt to)-2.5 E(create them.)0 72 Q 0 Cg EP -%%Page: 23 23 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(In some cases, this can pro)0 12 Q .3 -.15(ve t) --.15 H 2.5(ob).15 G 2.5(eas)-2.5 G(igni\214cant performance impro)-2.5 E --.15(ve)-.15 G(ment.).15 E(By def)0 24 Q(ault, e)-.1 E -(xisting \214les are truncated and re)-.15 E(written, b)-.25 E(ut)-.2 E -(the \214le is not recreated.)0 36 Q(In particular)0 48 Q 2.5(,t)-.4 G -(he def)-2.5 E(ault beha)-.1 E(vior does not break e)-.2 E -(xisting hard links.)-.15 E(<dt><b></b><b>ARCHIVE_EXTRA)0 60 Q(CT_A)-.4 -E(CL</b><dd>)-.4 E(Attempt to restore A)0 72 Q(CLs.)-.4 E 0 Cg EP -%%Page: 24 24 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(By def)0 12 Q(ault, e)-.1 E(xtended A)-.15 E -(CLs are ignored.)-.4 E(<dt><b></b><b>ARCHIVE_EXTRA)0 24 Q(CT_FFLA)-.4 E -(GS</b><dd>)-.4 E(Attempt to restore e)0 36 Q(xtended \214le \215ags.) --.15 E(By def)0 48 Q(ault, \214le \215ags are ignored.)-.1 E -(<dt><b></b><b>ARCHIVE_EXTRA)0 60 Q(CT_XA)-.4 E(TTR</b><dd>)-1.11 E -(Attempt to restore POSIX.1e e)0 72 Q(xtended attrib)-.15 E(utes.)-.2 E -0 Cg EP -%%Page: 25 25 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(By def)0 12 Q(ault, the)-.1 E 2.5(ya)-.15 G -(re ignored.)-2.5 E(<dt><b></b><b>ARCHIVE_EXTRA)0 24 Q -(CT_SECURE_SYMLINKS</b><dd>)-.4 E(Refuse to e)0 36 Q(xtract an)-.15 E -2.5(yo)-.15 G(bject whose \214nal location w)-2.5 E(ould be altered)-.1 -E(by a symlink on disk.)0 48 Q(This is intended to help guard ag)0 60 Q -(ainst a v)-.05 E(ariety of mischief)-.25 E(caused by archi)0 72 Q -.15 -(ve)-.25 G 2.5(st).15 G(hat \(deliberately or otherwise\) e)-2.5 E -(xtract)-.15 E 0 Cg EP -%%Page: 26 26 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(\214les outside of the current directory)0 12 Q -(.)-.65 E(The def)0 24 Q(ault is not to perform this check.)-.1 E(If)0 -36 Q(<b></b><b>ARCHIVE_EXTRA)0 48 Q(CT_UNLINK</b>)-.4 E -(is speci\214ed together with this option, the library will)0 60 Q(remo) -0 72 Q .3 -.15(ve a)-.15 H .3 -.15(ny i).15 H -(ntermediate symlinks it \214nds and return an).15 E 0 Cg EP -%%Page: 27 27 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(error only if such symlink could not be remo)0 -12 Q -.15(ve)-.15 G(d.).15 E(<dt><b></b><b>ARCHIVE_EXTRA)0 24 Q -(CT_SECURE_NODO)-.4 E(TDO)-.4 E(T</b><dd>)-.4 E(Refuse to e)0 36 Q -(xtract a path that contains a)-.15 E(<code></code><code>..</code>)0 48 -Q(element an)0 60 Q(ywhere within it.)-.15 E(The def)0 72 Q -(ault is to not refuse such paths.)-.1 E 0 Cg EP -%%Page: 28 28 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(Note that paths ending in)0 12 Q -(<code></code><code>..</code>)0 24 Q(al)0 36 Q -.1(wa)-.1 G -(ys cause an error).1 E 2.5(,r)-.4 G -2.25 -.15(eg a)-2.5 H -(rdless of this \215ag.).15 E(<dt><b></b><b>ARCHIVE_EXTRA)0 48 Q(CT_SP) --.4 E(ARSE</b><dd>)-.92 E -(Scan data for blocks of NUL bytes and try to recreate them with holes.) -0 60 Q(This results in sparse \214les, independent of whether the archi) -0 72 Q .3 -.15(ve f)-.25 H(ormat).15 E 0 Cg EP -%%Page: 29 29 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(supports or uses them.)0 12 Q(</dl>)0 24 Q -(<p><dt>Xo<dd>)0 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G -(_write_disk_set_group_lookup</b>\(<code></code>\),).15 E(<b>archi)0 60 -Q -.15(ve)-.25 G(_write_disk_set_user_lookup</b>\(<code></code>\)).15 E -(The)0 72 Q 0 Cg EP -%%Page: 30 30 -%%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 -(objects contain both names and ids that can be used to identify users)0 -24 Q(and groups.)0 36 Q(These names and ids describe the o)0 48 Q -(wnership of the \214le itself and)-.25 E(also appear in A)0 60 Q -(CL lists.)-.4 E(By def)0 72 Q -(ault, the library uses the ids and ignores the names, b)-.1 E(ut)-.2 E -0 Cg EP -%%Page: 31 31 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(this can be o)0 12 Q -.15(ve)-.15 G -(rridden by re).15 E(gistering user and group lookup functions.)-.15 E -1.6 -.8(To r)0 24 T -.15(eg).8 G(ister).15 E 2.5(,y)-.4 G(ou must pro) --2.5 E(vide a lookup function which)-.15 E -(accepts both a name and id and returns a suitable id.)0 36 Q -1.1(Yo)0 -48 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 60 Q -(oid</font><font size="-1"> *</font>)-.2 E(pointer to a pri)0 72 Q -.25 -(va)-.25 G(te data structure and a cleanup function for).25 E 0 Cg EP -%%Page: 32 32 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(that data.)0 12 Q -(The cleanup function will be in)0 24 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw) -.1 G(hen the)-2.5 E(<font size="-1"></font><font size="-1">struct</font\ -><font size="-1"> archi)0 36 Q -.15(ve)-.25 G(</font>).15 E -(object is destro)0 48 Q(yed.)-.1 E(<p><dt><b>archi)0 60 Q -.15(ve)-.25 -G(_write_disk_set_standard_lookup</b>\(<code></code>\)<dd>).15 E -(This con)0 72 Q -.15(ve)-.4 G -(nience function installs a standard set of user).15 E 0 Cg EP -%%Page: 33 33 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(and group lookup functions.)0 12 Q -(These functions use)0 24 Q -(<a href="../html3/getpwnam.html">getpwnam\(3\)</a>)0 36 Q(and)0 48 Q -(<a href="../html3/getgrnam.html">getgrnam\(3\)</a>)0 60 Q(to con)0 72 Q --.15(ve)-.4 G(rt names to ids, def).15 E -(aulting to the ids if the names cannot)-.1 E 0 Cg EP -%%Page: 34 34 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(be look)0 12 Q(ed up.)-.1 E -(These functions also implement a simple memory cache to reduce)0 24 Q -(the number of calls to)0 36 Q -(<a href="../html3/getpwnam.html">getpwnam\(3\)</a>)0 48 Q(and)0 60 Q -(<a href="../html3/getgrnam.html">getgrnam\(3\)</a>.)0 72 Q 0 Cg EP -%%Page: 35 35 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G -(_write_header</b>\(<code></code>\)<dd>).15 E -(Build and write a header using the data in the pro)0 24 Q(vided)-.15 E -(<font size="-1"></font><font size="-1">struct</font><font size="-1"> a\ -rchi)0 36 Q -.15(ve)-.25 G(_entry</font>).15 E(structure.)0 48 Q(See)0 -60 Q(<a href="../html3/archi)0 72 Q -.15(ve)-.25 G(_entry).15 E -(.html">archi)-.65 E -.15(ve)-.25 G(_entry\(3\)</a>).15 E 0 Cg EP -%%Page: 36 36 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(for information on creating and populating)0 12 -Q(<font size="-1"></font><font size="-1">struct</font><font size="-1"> \ -archi)0 24 Q -.15(ve)-.25 G(_entry</font>).15 E(objects.)0 36 Q -(<p><dt><b>archi)0 48 Q -.15(ve)-.25 G -(_write_data</b>\(<code></code>\)<dd>).15 E -(Write data corresponding to the header just written.)0 60 Q -(Returns number of bytes written or -1 on error)0 72 Q(.)-.55 E 0 Cg EP -%%Page: 37 37 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G -(_write_\214nish_entry</b>\(<code></code>\)<dd>).15 E -(Close out the entry just written.)0 24 Q(Ordinarily)0 36 Q 2.5(,c)-.65 -G(lients ne)-2.5 E -.15(ve)-.25 G 2.5(rn).15 G(eed to call this, as it) --2.5 E(is called automatically by)0 48 Q(<b>archi)0 60 Q -.15(ve)-.25 G -(_write_ne).15 E(xt_header</b>\(<code></code>\))-.15 E(and)0 72 Q 0 Cg -EP -%%Page: 38 38 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_write_close</b>\(<code></code>\)).15 E(as needed.)0 24 Q -(<p><dt><b>archi)0 36 Q -.15(ve)-.25 G -(_write_close</b>\(<code></code>\)<dd>).15 E(Set an)0 48 Q 2.5(ya)-.15 G -(ttrib)-2.5 E(utes that could not be set during the initial restore.)-.2 -E -.15(Fo)0 60 S 2.5(re).15 G -(xample, directory timestamps are not restored initially because)-2.65 E -(restoring a subsequent \214le w)0 72 Q(ould alter that timestamp.)-.1 E -0 Cg EP -%%Page: 39 39 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(Similarly)0 12 Q 2.5(,n)-.65 G -(on-writable directories are initially created with)-2.5 E -(write permissions \(so that their contents can be restored\).)0 24 Q -(The)0 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G(_write_disk_ne).15 E(w</b>) --.25 E(library maintains a list of all such deferred attrib)0 60 Q -(utes and)-.2 E(sets them when this function is in)0 72 Q -.2(vo)-.4 G --.1(ke).2 G(d.).1 E 0 Cg EP -%%Page: 40 40 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G -(_write_\214nish</b>\(<code></code>\)<dd>).15 E(In)0 24 Q -.2(vo)-.4 G --.1(ke).2 G(s).1 E(<b>archi)0 36 Q -.15(ve)-.25 G -(_write_close</b>\(<code></code>\)).15 E(if it w)0 48 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 60 Q -(More information about the)0 72 Q 0 Cg EP -%%Page: 41 41 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<i></i><i>struct</i><i> archi)0 12 Q -.15(ve) --.25 G(</i>).15 E(object and the o)0 24 Q -.15(ve)-.15 G -(rall design of the library can be found in the).15 E -(<a href="../html3/libarchi)0 36 Q -.15(ve)-.25 G(.html">libarchi).15 E --.15(ve)-.25 G(\(3\)</a>).15 E -.15(ove)0 48 S(rvie).15 E -.65(w.)-.25 G -(Man)0 60 Q 2.5(yo)-.15 G 2.5(ft)-2.5 G -(hese functions are also documented under)-2.5 E -(<a href="../html3/archi)0 72 Q -.15(ve)-.25 G(_write.html">archi).15 E --.15(ve)-.25 G(_write\(3\)</a>.).15 E 0 Cg EP -%%Page: 42 42 -%%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 non-zero).15 E 0 Cg EP -%%Page: 43 43 -%%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: 44 44 -%%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(<b>archi)0 48 Q -.15 -(ve)-.25 G(_errno</b>\(<code></code>\)).15 E(and)0 60 Q(<b>archi)0 72 Q --.15(ve)-.25 G(_error_string</b>\(<code></code>\)).15 E 0 Cg EP -%%Page: 45 45 -%%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(<p>)36 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G -(_write_disk_ne).15 E(w</b>\(<code></code>\))-.25 E -(returns a pointer to a ne)0 60 Q(wly-allocated)-.25 E(<font size="-1">\ -</font><font size="-1">struct</font><font size="-1"> archi)0 72 Q -.15 -(ve)-.25 G(</font>).15 E 0 Cg EP -%%Page: 46 46 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(object.)0 12 Q(<p>)36 24 Q(<b>archi)0 36 Q -.15 -(ve)-.25 G(_write_data</b>\(<code></code>\)).15 E -(returns a count of the number of bytes actually written.)0 48 Q -(On error)0 60 Q 2.5(,-)-.4 G 2.5(1i)-2.5 G 2.5(sr)-2.5 G -(eturned and the)-2.5 E(<b>archi)0 72 Q -.15(ve)-.25 G -(_errno</b>\(<code></code>\)).15 E 0 Cg EP -%%Page: 47 47 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(and)0 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G -(_error_string</b>\(<code></code>\)).15 E -(functions will return appropriate v)0 36 Q(alues.)-.25 E -(<h3 id="SEE ALSO">)36 48 Q(SEE ALSO)36 60 Q(</h3>)36 72 Q 0 Cg EP -%%Page: 48 48 -%%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="../html1/tar)0 36 Q -(.html">tar\(1\)</a>,)-.55 E(<a href="../html3/libarchi)0 48 Q -.15(ve) --.25 G(.html">libarchi).15 E -.15(ve)-.25 G(\(3\)</a>).15 E -(<h3 id="HIST)36 60 Q(OR)-.18 E(Y">)-.65 E(HIST)36 72 Q(OR)-.18 E(Y)-.65 -E 0 Cg EP -%%Page: 49 49 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(</h3>)36 12 Q(The)0 24 Q(<b>libarchi)0 36 Q -.15 -(ve)-.25 G(</b>).15 E(library \214rst appeared in)0 48 Q(FreeBSD5.3.)0 -60 Q(The)0 72 Q 0 Cg EP -%%Page: 50 50 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G(_write_disk</b>) -.15 E(interf)0 24 Q(ace w)-.1 E(as added to)-.1 E(<b>libarchi)0 36 Q --.15(ve)-.25 G(</b><b>2.0</b>).15 E(and \214rst appeared in)0 48 Q -(FreeBSD6.3.)0 60 Q(<h3 id="A)36 72 Q(UTHORS">)-.55 E 0 Cg EP -%%Page: 51 51 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -.55(AU)36 12 S(THORS).55 E(</h3>)36 24 Q(<p>)36 -36 Q(The)0 48 Q(<b>libarchi)0 60 Q -.15(ve)-.25 G(</b>).15 E(library w)0 -72 Q(as written by)-.1 E 0 Cg EP -%%Page: 52 52 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -.35(Ti)0 12 S 2.5(mK).35 G -(ientzle <kientzle@acm.or)-2.5 E(g>.)-.18 E(<h3 id="B)36 24 Q -(UGS">)-.1 E -.1(BU)36 36 S(GS).1 E(</h3>)36 48 Q -(Directories are actually e)0 60 Q(xtracted in tw)-.15 E 2.5(od)-.1 G -(istinct phases.)-2.5 E(Directories are created during)0 72 Q 0 Cg EP -%%Page: 53 53 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G -(_write_header</b>\(<code></code>\),).15 E -.2(bu)0 24 S 2.5<748c>.2 G -(nal permissions are not set until)-2.5 E(<b>archi)0 36 Q -.15(ve)-.25 G -(_write_close</b>\(<code></code>\).).15 E -(This separation is necessary to correctly handle borderline)0 48 Q -(cases such as a non-writable directory containing)0 60 Q(\214les, b)0 -72 Q(ut can cause une)-.2 E(xpected results.)-.15 E 0 Cg EP -%%Page: 54 54 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(In particular)0 12 Q 2.5(,d)-.4 G -(irectory permissions are not fully)-2.5 E(restored until the archi)0 24 -Q .3 -.15(ve i)-.25 H 2.5(sc).15 G(losed.)-2.5 E(If you use)0 36 Q -(<a href="../html2/chdir)0 48 Q(.html">chdir\(2\)</a>)-.55 E -(to change the current directory between calls to)0 60 Q(<b>archi)0 72 Q --.15(ve)-.25 G(_read_e).15 E(xtract</b>\(<code></code>\))-.15 E 0 Cg EP -%%Page: 55 55 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(or before calling)0 12 Q(<b>archi)0 24 Q -.15 -(ve)-.25 G(_read_close</b>\(<code></code>\),).15 E -(you may confuse the permission-setting logic with)0 36 Q -(the result that directory permissions are restored)0 48 Q(incorrectly)0 -60 Q(.)-.65 E(<p>)36 72 Q 0 Cg EP -%%Page: 56 56 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -(The library attempts to create objects with \214lenames longer than)0 -12 Q(<b></b><b>P)0 24 Q -1.11(AT)-.92 G(H_MAX</b>)1.11 E -(by creating pre\214x)0 36 Q -(es of the full path and changing the current directory)-.15 E(.)-.65 E -(Currently)0 48 Q 2.5(,t)-.65 G -(his logic is limited in scope; the \214xup pass does)-2.5 E(not w)0 60 -Q(ork correctly for such objects and the symlink security check)-.1 E -(option disables the support for v)0 72 Q(ery long pathnames.)-.15 E 0 -Cg EP -%%Page: 57 57 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<p>)36 12 Q(Restoring the path)0 24 Q -(<code></code><code>aa/../bb</code>)0 36 Q -(does create each intermediate directory)0 48 Q(.)-.65 E(In particular)0 -60 Q 2.5(,t)-.4 G(he directory)-2.5 E(<code></code><code>aa</code>)0 72 -Q 0 Cg EP -%%Page: 58 58 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(is created as well as the \214nal object)0 12 Q -(<code></code><code>bb</code>.)0 24 Q(In theory)0 36 Q 2.5(,t)-.65 G -(his can be e)-2.5 E(xploited to create an entire directory heirarch) --.15 E(y)-.05 E(with a single request.)0 48 Q -(Of course, this does not w)0 60 Q(ork if the)-.1 E -(<b></b><b>ARCHIVE_EXTRA)0 72 Q(CT_NODO)-.4 E(TDO)-.4 E(T</b>)-.4 E 0 Cg -EP -%%Page: 59 59 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(option is speci\214ed.)0 12 Q(<p>)36 24 Q -(Implicit directories are al)0 36 Q -.1(wa)-.1 G(ys created obe).1 E -(ying the current umask.)-.15 E(Explicit objects are created obe)0 48 Q -(ying the current umask unless)-.15 E(<b></b><b>ARCHIVE_EXTRA)0 60 Q -(CT_PERM</b>)-.4 E(is speci\214ed, in which case the)0 72 Q 2.5(yc)-.15 -G(urrent umask is ignored.)-2.5 E 0 Cg EP -%%Page: 60 60 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(<p>)36 12 Q -(SGID and SUID bits are restored only if the correct user and)0 24 Q -(group could be set.)0 36 Q(If)0 48 Q(<b></b><b>ARCHIVE_EXTRA)0 60 Q -(CT_O)-.4 E(WNER</b>)-.35 E -(is not speci\214ed, then no attempt is made to set the o)0 72 Q -(wnership.)-.25 E 0 Cg EP -%%Page: 61 61 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF -(In this case, SGID and SUID bits are restored only if the)0 12 Q -(user and group of the \214nal object happen to match those speci\214ed) -0 24 Q(in the entry)0 36 Q(.)-.65 E(<p>)36 48 Q(The)0 60 Q -.74(``)0 72 -S(standard').74 E(')-.74 E 0 Cg EP -%%Page: 62 62 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(user)0 12 Q -(-id and group-id lookup functions are not the def)-.2 E(aults because) --.1 E(<a href="../html3/getgrnam.html">getgrnam\(3\)</a>)0 24 Q(and)0 36 -Q(<a href="../html3/getpwnam.html">getpwnam\(3\)</a>)0 48 Q -(are sometimes too lar)0 60 Q(ge for particular applications.)-.18 E -(The current design allo)0 72 Q(ws the application author to use a more) --.25 E 0 Cg EP -%%Page: 63 63 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(compact implementation when appropriate.)0 12 Q -(<p>)36 24 Q(There should be a corresponding)0 36 Q(<b>archi)0 48 Q -.15 -(ve)-.25 G(_read_disk</b>).15 E(interf)0 60 Q(ace that w)-.1 E -(alks a directory heirarch)-.1 E 2.5(ya)-.05 G(nd returns archi)-2.5 E --.15(ve)-.25 G(entry objects.)0 72 Q 0 Cg EP -%%Trailer -end -%%EOF +<!-- Creator : groff version 1.22.3 --> +<!-- CreationDate: Sun Jun 19 19:54:08 2016 --> +<!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; vertical-align: top } + pre { margin-top: 0; margin-bottom: 0; vertical-align: top } + table { margin-top: 0; margin-bottom: 0; vertical-align: top } + h1 { text-align: center } +</style> +<title></title> +</head> +<body> + +<hr> + + +<p>ARCHIVE_WRITE_DISK(3) BSD Library Functions Manual +ARCHIVE_WRITE_DISK(3)</p> + +<p style="margin-top: 1em"><b>NAME</b></p> + +<p style="margin-left:6%;"><b>archive_write_disk_new</b>, +<b>archive_write_disk_set_options</b>, +<b>archive_write_disk_set_skip_file</b>, +<b>archive_write_disk_set_group_lookup</b>, +<b>archive_write_disk_set_standard_lookup</b>, +<b>archive_write_disk_set_user_lookup</b>, +<b>archive_write_header</b>, <b>archive_write_data</b>, +<b>archive_write_data_block</b>, +<b>archive_write_finish_entry</b>, +<b>archive_write_close</b>, <b>archive_write_finish +archive_write_free</b> — functions for creating +objects on disk</p> + +<p style="margin-top: 1em"><b>LIBRARY</b></p> + +<p style="margin-left:6%;">Streaming Archive Library +(libarchive, -larchive)</p> + +<p style="margin-top: 1em"><b>SYNOPSIS</b></p> + +<p style="margin-left:6%;"><b>#include +<archive.h></b></p> + +<p style="margin-left:6%; margin-top: 1em"><i>struct +archive *</i></p> + + +<p style="margin-left:12%;"><b>archive_write_disk_new</b>(<i>void</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:12%;"><b>archive_write_disk_set_options</b>(<i>struct archive *</i>, +<i>int flags</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:12%;"><b>archive_write_disk_set_skip_file</b>(<i>struct archive *</i>, +<i>dev_t</i>, <i>ino_t</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p><b>archive_write_disk_set_group_lookup</b>(<i>struct archive *</i>, +<i>void *</i>, +<i>gid_t (*)(void *, const char *gname, gid_t gid)</i>, +<i>void (*cleanup)(void *)</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:12%;"><b>archive_write_disk_set_standard_lookup</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p><b>archive_write_disk_set_user_lookup</b>(<i>struct archive *</i>, +<i>void *</i>, +<i>uid_t (*)(void *, const char *uname, uid_t uid)</i>, +<i>void (*cleanup)(void *)</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:12%;"><b>archive_write_header</b>(<i>struct archive *</i>, +<i>struct archive_entry *</i>);</p> + + +<p style="margin-left:6%; margin-top: 1em"><i>la_ssize_t</i></p> + + +<p style="margin-left:12%;"><b>archive_write_data</b>(<i>struct archive *</i>, +<i>const void *</i>, <i>size_t</i>);</p> + + +<p style="margin-left:6%; margin-top: 1em"><i>la_ssize_t</i></p> + + +<p style="margin-left:12%;"><b>archive_write_data_block</b>(<i>struct archive *</i>, +<i>const void *</i>, <i>size_t size</i>, +<i>int64_t offset</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:12%;"><b>archive_write_finish_entry</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:12%;"><b>archive_write_close</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:12%;"><b>archive_write_finish</b>(<i>struct archive *</i>);</p> + +<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> + + +<p style="margin-left:12%;"><b>archive_write_free</b>(<i>struct archive *</i>);</p> + +<p style="margin-top: 1em"><b>DESCRIPTION</b></p> + +<p style="margin-left:6%;">These functions provide a +complete API for creating objects on disk from struct +archive_entry descriptions. They are most naturally used +when extracting objects from an archive using the +<b>archive_read</b>() interface. The general process is to +read struct archive_entry objects from an archive, then +write those objects to a struct archive object created using +the <b>archive_write_disk</b>() family functions. This +interface is deliberately very similar to the +<b>archive_write</b>() interface used to write objects to a +streaming archive.</p> + + +<p style="margin-top: 1em"><b>archive_write_disk_new</b>()</p> + +<p style="margin-left:17%;">Allocates and initializes a +struct archive object suitable for writing objects to +disk.</p> + + +<p style="margin-top: 1em"><b>archive_write_disk_set_skip_file</b>()</p> + +<p style="margin-left:17%;">Records the device and inode +numbers of a file that should not be overwritten. This is +typically used to ensure that an extraction process does not +overwrite the archive from which objects are being read. +This capability is technically unnecessary but can be a +significant performance optimization in practice.</p> + + +<p style="margin-top: 1em"><b>archive_write_disk_set_options</b>()</p> + +<p style="margin-left:17%;">The options field consists of a +bitwise OR of one or more of the following values:</p> + +<p><b>ARCHIVE_EXTRACT_OWNER</b></p> + +<p style="margin-left:27%;">The user and group IDs should +be set on the restored file. By default, the user and group +IDs are not restored.</p> + +<p><b>ARCHIVE_EXTRACT_PERM</b></p> + +<p style="margin-left:27%;">Full permissions (including +SGID, SUID, and sticky bits) should be restored exactly as +specified, without obeying the current umask. Note that SUID +and SGID bits can only be restored if the user and group ID +of the object on disk are correct. If +<b>ARCHIVE_EXTRACT_OWNER</b> is not specified, then SUID and +SGID bits will only be restored if the default user and +group IDs of newly-created objects on disk happen to match +those specified in the archive entry. By default, only basic +permissions are restored, and umask is obeyed.</p> + +<p><b>ARCHIVE_EXTRACT_TIME</b></p> + +<p style="margin-left:27%;">The timestamps (mtime, ctime, +and atime) should be restored. By default, they are ignored. +Note that restoring of atime is not currently supported.</p> + +<p><b>ARCHIVE_EXTRACT_NO_OVERWRITE</b></p> + +<p style="margin-left:27%;">Existing files on disk will not +be overwritten. By default, existing regular files are +truncated and overwritten; existing directories will have +their permissions updated; other pre-existing objects are +unlinked and recreated from scratch.</p> + +<p><b>ARCHIVE_EXTRACT_UNLINK</b></p> + +<p style="margin-left:27%;">Existing files on disk will be +unlinked before any attempt to create them. In some cases, +this can prove to be a significant performance improvement. +By default, existing files are truncated and rewritten, but +the file is not recreated. In particular, the default +behavior does not break existing hard links.</p> + +<p><b>ARCHIVE_EXTRACT_ACL</b></p> + +<p style="margin-left:27%;">Attempt to restore ACLs. By +default, extended ACLs are ignored.</p> + +<p><b>ARCHIVE_EXTRACT_FFLAGS</b></p> + +<p style="margin-left:27%;">Attempt to restore extended +file flags. By default, file flags are ignored.</p> + +<p><b>ARCHIVE_EXTRACT_XATTR</b></p> + +<p style="margin-left:27%;">Attempt to restore POSIX.1e +extended attributes. By default, they are ignored.</p> + +<p><b>ARCHIVE_EXTRACT_SECURE_SYMLINKS</b></p> + +<p style="margin-left:27%;">Refuse to extract any object +whose final location would be altered by a symlink on disk. +This is intended to help guard against a variety of mischief +caused by archives that (deliberately or otherwise) extract +files outside of the current directory. The default is not +to perform this check. If <b>ARCHIVE_EXTRACT_UNLINK</b> is +specified together with this option, the library will remove +any intermediate symlinks it finds and return an error only +if such symlink could not be removed.</p> + +<p><b>ARCHIVE_EXTRACT_SECURE_NODOTDOT</b></p> + +<p style="margin-left:27%;">Refuse to extract a path that +contains a <i>..</i> element anywhere within it. The default +is to not refuse such paths. Note that paths ending in +<i>..</i> always cause an error, regardless of this +flag.</p> + +<p><b>ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS</b></p> + +<p style="margin-left:27%;">Refuse to extract an absolute +path. The default is to not refuse such paths.</p> + +<p><b>ARCHIVE_EXTRACT_SPARSE</b></p> + +<p style="margin-left:27%;">Scan data for blocks of NUL +bytes and try to recreate them with holes. This results in +sparse files, independent of whether the archive format +supports or uses them.</p> + +<p><b>ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS</b></p> + +<p style="margin-left:27%;">Before removing a file system +object prior to replacing it, clear platform-specific file +flags which might prevent its removal.</p> + + +<p style="margin-top: 1em"><b>archive_write_disk_set_group_lookup</b>(), +<b>archive_write_disk_set_user_lookup</b>()</p> + +<p style="margin-left:17%;">The struct archive_entry +objects contain both names and ids that can be used to +identify users and groups. These names and ids describe the +ownership of the file itself and also appear in ACL lists. +By default, the library uses the ids and ignores the names, +but this can be overridden by registering user and group +lookup functions. To register, you must provide a lookup +function which accepts both a name and id and returns a +suitable id. 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.</p> + + +<p style="margin-top: 1em"><b>archive_write_disk_set_standard_lookup</b>()</p> + +<p style="margin-left:17%;">This convenience function +installs a standard set of user and group lookup functions. +These functions use getpwnam(3) and getgrnam(3) to convert +names to ids, defaulting to the ids if the names cannot be +looked up. These functions also implement a simple memory +cache to reduce the number of calls to getpwnam(3) and +getgrnam(3).</p> + + +<p style="margin-top: 1em"><b>archive_write_header</b>()</p> + +<p style="margin-left:17%;">Build and write a header using +the data in the provided struct archive_entry structure. See +archive_entry(3) for information on creating and populating +struct archive_entry objects.</p> + +<p style="margin-top: 1em"><b>archive_write_data</b>()</p> + +<p style="margin-left:17%;">Write data corresponding to the +header just written. Returns number of bytes written or -1 +on error.</p> + + +<p style="margin-top: 1em"><b>archive_write_data_block</b>()</p> + +<p style="margin-left:17%;">Write data corresponding to the +header just written. This is like +<b>archive_write_data</b>() except that it performs a seek +on the file being written to the specified offset before +writing the data. This is useful when restoring sparse files +from archive formats that support sparse files. Returns +number of bytes written or -1 on error. (Note: This is +currently not supported for archive_write handles, only for +archive_write_disk handles.)</p> + + +<p style="margin-top: 1em"><b>archive_write_finish_entry</b>()</p> + +<p style="margin-left:17%;">Close out the entry just +written. Ordinarily, clients never need to call this, as it +is called automatically by +<b>archive_write_next_header</b>() and +<b>archive_write_close</b>() as needed. However, some file +attributes are written to disk only after the file is +closed, so this can be necessary if you need to work with +the file on disk right away.</p> + + +<p style="margin-top: 1em"><b>archive_write_close</b>()</p> + +<p style="margin-left:17%;">Set any attributes that could +not be set during the initial restore. For example, +directory timestamps are not restored initially because +restoring a subsequent file would alter that timestamp. +Similarly, non-writable directories are initially created +with write permissions (so that their contents can be +restored). The <b>archive_write_disk_new</b> library +maintains a list of all such deferred attributes and sets +them when this function is invoked.</p> + + +<p style="margin-top: 1em"><b>archive_write_finish</b>()</p> + +<p style="margin-left:17%;">This is a deprecated synonym +for <b>archive_write_free</b>().</p> + +<p style="margin-top: 1em"><b>archive_write_free</b>()</p> + +<p style="margin-left:17%;">Invokes +<b>archive_write_close</b>() if it was not invoked manually, +then releases all resources.</p> + +<p style="margin-left:6%;">More information about the +<i>struct archive</i> object and the overall design of the +library can be found in the libarchive(3) overview. Many of +these functions are also documented under +archive_write(3).</p> + +<p style="margin-top: 1em"><b>RETURN VALUES</b></p> + +<p style="margin-left:6%;">Most functions return +<b>ARCHIVE_OK</b> (zero) on success, or one of several +non-zero 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.</p> + + +<p style="margin-left:6%; margin-top: 1em"><b>archive_write_disk_new</b>() +returns a pointer to a newly-allocated struct archive +object.</p> + + +<p style="margin-left:6%; margin-top: 1em"><b>archive_write_data</b>() +returns a count of the number of bytes actually written, or +-1 on error.</p> + +<p style="margin-top: 1em"><b>ERRORS</b></p> + +<p style="margin-left:6%;">Detailed error codes and textual +descriptions are available from the <b>archive_errno</b>() +and <b>archive_error_string</b>() functions.</p> + +<p style="margin-top: 1em"><b>SEE ALSO</b></p> + +<p style="margin-left:6%;">archive_read(3), +archive_write(3), tar(1), libarchive(3)</p> + +<p style="margin-top: 1em"><b>HISTORY</b></p> + +<p style="margin-left:6%;">The <b>libarchive</b> library +first appeared in FreeBSD 5.3. The +<b>archive_write_disk</b> interface was added to +<b>libarchive 2.0</b> and first appeared in +FreeBSD 6.3.</p> + +<p style="margin-top: 1em"><b>AUTHORS</b></p> + +<p style="margin-left:6%;">The <b>libarchive</b> library +was written by Tim Kientzle <kientzle@acm.org>.</p> + +<p style="margin-top: 1em"><b>BUGS</b></p> + +<p style="margin-left:6%;">Directories are actually +extracted in two distinct phases. Directories are created +during <b>archive_write_header</b>(), but final permissions +are not set until <b>archive_write_close</b>(). This +separation is necessary to correctly handle borderline cases +such as a non-writable directory containing files, but can +cause unexpected results. In particular, directory +permissions are not fully restored until the archive is +closed. If you use chdir(2) to change the current directory +between calls to <b>archive_read_extract</b>() or before +calling <b>archive_read_close</b>(), you may confuse the +permission-setting logic with the result that directory +permissions are restored incorrectly.</p> + +<p style="margin-left:6%; margin-top: 1em">The library +attempts to create objects with filenames longer than +<b>PATH_MAX</b> by creating prefixes of the full path and +changing the current directory. Currently, this logic is +limited in scope; the fixup pass does not work correctly for +such objects and the symlink security check option disables +the support for very long pathnames.</p> + +<p style="margin-left:6%; margin-top: 1em">Restoring the +path <i>aa/../bb</i> does create each intermediate +directory. In particular, the directory <i>aa</i> is created +as well as the final object <i>bb</i>. In theory, this can +be exploited to create an entire directory hierarchy with a +single request. Of course, this does not work if the +<b>ARCHIVE_EXTRACT_NODOTDOT</b> option is specified.</p> + +<p style="margin-left:6%; margin-top: 1em">Implicit +directories are always created obeying the current umask. +Explicit objects are created obeying the current umask +unless <b>ARCHIVE_EXTRACT_PERM</b> is specified, in which +case they current umask is ignored.</p> + +<p style="margin-left:6%; margin-top: 1em">SGID and SUID +bits are restored only if the correct user and group could +be set. If <b>ARCHIVE_EXTRACT_OWNER</b> is not specified, +then no attempt is made to set the ownership. In this case, +SGID and SUID bits are restored only if the user and group +of the final object happen to match those specified in the +entry.</p> + +<p style="margin-left:6%; margin-top: 1em">The +’’standard’’ user-id and group-id +lookup functions are not the defaults because getgrnam(3) +and getpwnam(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:6%; margin-top: 1em">There should be +a corresponding <b>archive_read_disk</b> interface that +walks a directory hierarchy and returns archive entry +objects.</p> + +<p style="margin-left:6%; margin-top: 1em">BSD +February 2, 2012 BSD</p> +<hr> +</body> +</html> |