📄 pax.html
字号:
<dt><b>00200</b><dd>Write by owner.<dt><b>00100</b><dd>Execute/search by owner.<dt><b>00040</b><dd>Read by group.<dt><b>00020</b><dd>Write by group.<dt><b>00010</b><dd>Execute/search by group.<dt><b>00004</b><dd>Read by other.<dt><b>00002</b><dd>Write by other.<dt><b>00001</b><dd>Execute/search by other.</dl><p>When appropriate privilege isrequired to set one of these mode bits, and the user restoring thefiles from the archive does not have the appropriate privilege,the mode bits for which the user does not have appropriate privilegewill be ignored.Some of the mode bits in the archive formatare not mentioned elsewhere in this specification.If the implementationdoes not support those bits, they may be ignored.<p>The<b>uid</b>and<b>gid</b>fields are the user and group IDof the owner and group of the file, respectively.<p>The<b>size</b>field is the size of the file in octets.If the<b>typeflag</b>field is set to specify a file to be of type1(a link)or2(reserved for symbolic links),the<b>size</b>field will be specified as zero.If the<b>typeflag</b>field is set to specify a file of type5(directory), the<b>size</b>field will be interpreted as described underthe definition of that record type.No data blocks will be stored for types1,2or5.If the<b>typeflag</b>field is set to3(character special file),4(block special file),or6(FIFO),the meaning of the<b>size</b>field is unspecified by this specification, and no datablocks will be stored on the medium.Additionally, for6,the<b>size</b>field is ignored when reading.If the<b>typeflag</b>field is setto any other value,<b>(size +511)/512</b>,the number of blocks written following the header will beignoring any fraction in the result of the division.<p>The<b>mtime</b>field is the modification time of the file at the timeit was archived.It is the ISO/IEC 646:1991 standard representation of the octal value of themodification time obtained from the <b>XSH</b> specification<i><a href="../xsh/stat.html">stat()</a></i>function.<p>The<b>chksum</b>field is the ISO/IEC 646:1991 standard IRV representation of the octal value of thesimple sum of all octets in the header block.Each octet in the header is treated as an unsigned value.These values will be added to an unsigned integer,initialised to zero, the precision of which will be notless than 17 bits.When calculating thechecksum, the<b>chksum</b>field is treated as if it were all spaces.<p>The<b>typeflag</b>field specifies the type of file archived.If aparticular implementation does not recognise the type, or theuser does not have appropriate privilege to create that type,the file will be extracted as if it were a regular file if thefile type is defined to have a meaning for the<b>size</b>field that could cause data blocks to be written on the medium (see theprevious description for<i>size ).</i>If conversion to a regular file occurs, the<i>pax</i>utility will producean error indicating that the conversion took place.All of the<b>typeflag</b>fields will be coded in the ISO/IEC 646:1991 standard IRV:<dl compact><dt><b>'0'</b><dd>Represents a regular file.For backward compatibility, a<b>typeflag</b>value of binary zero('\0')should be recognised as meaning a regular filewhen extracting files from the archive.Archiveswritten with this version of the archive file formatcreate regular files with a<b>typeflag</b>value of the ISO/IEC 646:1991 standard IRV0.<dt><b>'1'</b><dd>Represents a file linked to another file, ofany type, previously archived.Such files areidentified by each file having the same device and file serial number.The linked-to name is specified in the<b>linkname</b>field with a NUL-character terminator if it is less than100 octets in length.<dt><b>'2'</b><dd>Reserved to represent a link to another file, ofany type, whose device or file serial number differs.This is provided for systems that support linked fileswhose device or file serial numbers differ, and shouldbe treated as a type1file if this extension does not exist.<dt><b>'3','4'</b><dd>Represent character special filesand block special files respectively.In this case the<b>devmajor</b>and<b>devminor</b>fields contain information defining the device, theformat of which is unspecified by this specification.Implementations may map the device specifications to their own localspecification or may ignore the entry.<dt><b>'5'</b><dd>Specifies a directory or subdirectory.On systems where disk allocation is performed on adirectory basis, the<b>size</b>field will contain the maximumnumber of octets (which may be rounded to the nearestdisk block allocation unit) that the directory may hold.A<b>size</b>field of zero indicates no such limiting.Systems that do not support limiting in this mannershould ignore the<b>size</b>field.<dt><b>'6'</b><dd>Specifies a FIFO special file.Note that the archiving of a FIFO file archives theexistence of this file and not its contents.<dt><b>'7'</b><dd>Reserved to represent a file to which an implementationhas associated some high-performance attribute.Implementations without such extensions should treat thisfile as a regular file (type0).<dt><b>'A'-'Z'</b><dd>The lettersAtoZ,inclusive,are reserved for custom implementations.All other values arereserved for specification in future issues.</dl><p>The<b>magic</b>field is the specification that this archive was outputin this archive format.If this field contains<b>ustar</b>(the five characters from the ISO/IEC 646:1991 standard IRV shown followed by NUL),the<b>uname</b>and<b>gname</b>fields will contain the ISO/IEC 646:1991 standard IRVrepresentation of the owner and group of the file respectively(truncated to fit, if necessary).When the file is restored by a privileged, protection-preservingversion of the utility,the password and group files will be scanned for these names.If found, the user and group IDscontained within thesefiles will be used rather than the values containedwithin the<b>uid</b>and<b>gid</b>fields.</blockquote><h4><a name = "tag_001_014_1701"> </a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt>0<dd>All files were processed successfully.<dt>>0<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_1702"> </a>CONSEQUENCES OF ERRORS</h4><blockquote>If<i>pax</i>cannot create a file or a link when reading an archive orcannot find a file when writing an archive, or cannot preservethe user ID, group ID or file mode when the<b>-p</b>option isspecified, a diagnostic message will be written to standarderror and a non-zero exit status will be returned, butprocessing will continue.In the case where<i>pax</i>cannot create a link to a file,<i>pax</i>will not, by default, create a secondcopy of the file.<p>If the extraction of a file from an archive is prematurelyterminated by a signal or error,<i>pax</i>may have only partiallyextracted the file or (if the<b>-n</b>option was not specified) mayhave extracted a file of the same name as that specified by theuser, but which is not the file the user wanted.Additionally,the file modes of extracted directories may have additionalbits from the S_IRWXU mask set as well as incorrect modificationand access times.</blockquote><h4><a name = "tag_001_014_1703"> </a>APPLICATION USAGE</h4><blockquote>The<b>-p</b>(privileges) option was invented to reconcile differencesbetween historical<i><a href="tar.html">tar</a></i>and<i><a href="cpio.html">cpio</a></i>implementations.In particular, the two utilities use<b>-m</b>in diametrically opposed ways.The<b>-p</b>option also provides a consistent means ofextending the ways in whichfuture file attributes can be addressed,such as for enhanced security systemsor high-performance files.Although it may seem complex, there are reallytwo modes that will be most commonly used:<dl compact><dt><b>-p e</b><dd>"Preserve everything".This would be used by the historical superuser,someone with all the appropriate privileges,to preserve all aspects of the files asthey are recorded in the archive.The<b>e</b>flag is the sum of<b>o</b>and<b>p</b>,and other implementation-dependent attributes.<dt><b>-p p</b><dd>"Preserve" the file mode bits.This would be used by the user with regularprivileges who wished to preserve aspects ofthe file other than the ownership.The file times are preserved by default,but two other flags are offered to disable theseand use the time of extraction.</dl><p>The one pathname per line format of standard input precludespathnames containingnewline characters.Although such pathnames violatethe portable filename guidelines, they may exist and theirpresence may inhibit usage of<i>pax</i>within shell scripts.This problem is inherited from historical archive programs.The problem can be avoided by listingfilename arguments on the command lineinstead of on standard input.<p>It is almost certain that appropriate privileges will berequired for<i>pax</i>to accomplish parts of this specification.Specifically, creating files of type block special or characterspecial, restoring file access times unless the files are ownedby the user (the<b>-t</b>option) or preserving file owner, group,and mode (the<b>-p</b>option) will all probably require appropriate privileges.<p>In read mode,implementations are permitted to overwrite files when thearchive has multiple members with the same name.This may fail if permissions on the first version of the file donot permit it to be overwritten.<p>The<i><a href="cpio.html">cpio</a></i>and<i><a href="tar.html">tar</a></i>formats can only support files up to 8 gigabytes in size.<p>The <i>pax</i>utility is not able to handle arbitrary file sizes. There iscurrently a proposal in ballot in the IEEE PASC Shell and Utilities Working Group to address thisissue. </blockquote><h4><a name = "tag_001_014_1704"> </a>EXAMPLES</h4><blockquote>The following command:<pre><code>pax -w -f /dev/rmt/1m .</code></pre>copies the contents of the current directory to tape drive 1, medium density(assuminghistorical System V device naming procedures.The historicalBSD device name would be/dev/rmt9).<p>The following commands:<pre><code>mkdir <i>newdir</i>pax -rw <i>olddir</i> <i>newdir</i></code></pre>copy the<i>olddir</i>directory hierarchy to<i>newdir .</i><p><pre><code>pax -r -s ',^//*usr//*,,' -f a.pax</code></pre>reads the archive<b>a.pax</b>,with all files rooted in<b>/usr</b>in the archive extracted relative to the current directory.</blockquote><h4><a name = "tag_001_014_1705"> </a>FUTURE DIRECTIONS</h4><blockquote>It is expected that future versions of the ISO/IEC 9945-2:1993 standard willoffer additional file formats and the<b>-o</b>optionwill be used by future issuesto specify such features as international filenameand file codeset translations, security, accounting, and so on,related to each additional format.<p>The <i>pax</i>utility is not able to handle arbitrary file sizes. There iscurrently a proposal in ballot in the IEEE PASC Shell and Utilities Working Group to address thisissue. </blockquote><h4><a name = "tag_001_014_1706"> </a>SEE ALSO</h4><blockquote>None.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -