Seth Woolley's Man Viewer

spax(1) - pax - portable archive interchange - man 1 spax

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

SPAX(1L)                    Schilys USER COMMANDS                    SPAX(1L)



NAME
       pax - portable archive interchange

SYNOPSIS
       spax        [other options]      [-cdnv]      [-H|-L]      [-f archive]
              [-o options]...  [-s replstr]...  [pattern...]


       spax   -r   [other options]     [-cdiknuv]     [-H|-L]     [-f archive]
              [-o options]...  [-p string(3,n)]...  [-s replstr]...  [pattern...]


       spax   -w   [other options]   [-dituvX]   [-H|-L]  [-b blocksize]  [-a]
              [-f archive]   [-o options]...    [-s replstr]...    [-x format]
              [file(1,n)...]


       spax   -r -w[other options]    [-diklntuvX]   [-H|-L]   [-o options]...
              [-p string(3,n)]...  [-s replstr]...  [file(1,n)...] directory

DESCRIPTION
       The pax utility shall read(2,n,1 builtins), write(1,2), and write(1,2) lists of  the  members  of
       archive files and copy directory hierarchies. A variety of archive for-
       mats shall be supported; see the -x format option.

       The action to be taken depends  on  the  presence  of  the  -r  and  -w
       options. The four combinations of -r and -w are referred to as the four
       modes of operation: list, read(2,n,1 builtins), write(1,2), and  copy  modes,  corresponding
       respectively to the four forms shown in(1,8) the SYNOPSIS section.

       list   In  list  mode (when neither -r nor -w are specified), pax shall
              write(1,2) the names of the members of the archive file(1,n) read(2,n,1 builtins) from the
              standard  input, with pathnames matching the specified patterns,
              to standard output. If a named(5,8) file(1,n) is of  type  directory,  the
              file(1,n) hierarchy rooted at that file(1,n) shall be listed as well.

       read(2,n,1 builtins)   In  read(2,n,1 builtins)  mode  (when -r is specified, but -w is not), pax shall
              extract the members of the archive file(1,n) read(2,n,1 builtins) from  the  standard
              input,  with  pathnames  matching the specified patterns.  If an
              extracted file(1,n) is of type directory, the file(1,n)  hierarchy  rooted
              at  that  file(1,n)  shall  be extracted as well. The extracted files
              shall be created performing pathname resolution with the  direc-
              tory  in(1,8) which pax was invoked as the current working directory.

              If an attempt is made to extract a directory when the  directory
              already  exists,  this  shall  not be considered an error. If an
              attempt is made to extract a FIFO when the FIFO already  exists,
              this shall not be considered an error.

              The  ownership, access(2,5), and modification times, and file(1,n) mode of
              the restored files are discussed under the -p option.

       write(1,2)  In write(1,2) mode (when -w is specified, but -r is not),  pax  shall
              write(1,2)  the  contents of the file(1,n) operands to the standard output
              in(1,8) an archive format. If no file(1,n) operands are specified, a  list
              of  files to copy, one per line, shall be read(2,n,1 builtins) from the standard
              input. A file(1,n) of type directory shall include all of  the  files
              in(1,8) the file(1,n) hierarchy rooted at the file.

       copy   In copy mode (when both -r and -w are specified), pax shall copy
              the file(1,n) operands to the destination directory.

              If no file(1,n) operands are specified, a list of files to copy,  one
              per  line, shall be read(2,n,1 builtins) from the standard input. A file(1,n) of type
              directory shall include all of the files in(1,8) the  file(1,n)  hierarchy
              rooted at the file.

              The  effect  of  the  copy  shall be as if(3,n) the copied files were
              written to an archive  file(1,n)  and  then  subsequently  extracted,
              except that there may be hard links between the original and the
              copied files. If the destination directory is a subdirectory  of
              one  of  the files to be copied, the results are unspecified. If
              the destination directory is a file(1,n) of a type not defined by the
              System  Interfaces  volume  of IEEE Std 1003.1-2001, the results
              are implementation-defined; otherwise, it shall be an error(8,n)  for
              the  file(1,n)  named(5,8)  by  the directory operand not to exist, not be
              writable by the user, or not be a file(1,n) of type directory.

       In read(2,n,1 builtins) or copy modes, if(3,n) intermediate  directories  are  necessary  to
       extract  an archive member, pax shall perform actions equivalent to the
       mkdir(1,2)() function defined in(1,8) the System Interfaces volume  of  IEEE  Std
       1003.1-2001, called with the following arguments:

             The intermediate directory used as the path argument.

             The  value  of the bitwise-inclusive OR of S_IRWXU, S_IRWXG, and
              S_IRWXO as the mode argument.

       If any specified pattern or file(1,n) operands are not matched by  at  least
       one  file(1,n)  or  archive  member, pax shall write(1,2) a diagnostic message to
       standard error(8,n) for each one that did not match and exit(3,n,1 builtins) with a non-zero
       exit(3,n,1 builtins) status.

       The archive formats described in(1,8) the EXTENDED DESCRIPTION section shall
       be automatically detected on input. The default output  archive  format
       shall be implementation-defined.

       The spax implementation defaults to -x ustar.

       A  single archive can span multiple files. The pax utility shall deter-
       mine, in(1,8) an implementation-defined manner, what file(1,n) to read(2,n,1 builtins)  or  write(1,2)
       as the next file.

       If  the  selected  archive  format supports the specification of linked
       files, it shall be an error(8,n) if(3,n) these files cannot be  linked  when  the
       archive  is  extracted,  except that if(3,n) the files to be linked are sym-
       bolic links and the system is not capable of making hard links to  sym-
       bolic links, then separate copies of the symbolic link(1,2) shall be created
       instead. For archive formats that do not store file(1,n) contents with  each
       name that causes a hard link(1,2), if(3,n) the file(1,n) that contains the data is not
       extracted during this pax session, either the data  shall  be  restored
       from the original file(1,n), or a diagnostic message shall be displayed with
       the name of a file(1,n) that can be used to extract the data. In  traversing
       directories,  pax shall detect infinite loops; that is, entering a pre-
       viously visited directory that is an ancestor of the last file(1,n) visited.
       When  it detects an infinite loop, pax shall write(1,2) a diagnostic message
       to standard error(8,n) and shall terminate.


OPTIONS
       The pax utility shall conform to the Base Definitions  volume  of  IEEE
       Std  1003.1-2001,  Section 12.2, Utility Syntax Guidelines, except that
       the order of presentation of the -o, -p, and -s options is significant.

       The following options shall be supported:

       -r     Read an archive file(1,n) from standard input.

       -w     Write files to the standard output in(1,8) the specified archive for-
              mat.

       -a     Append files to the end of the archive.  It  is  implementation-
              defined  which  devices  on  the system support appending. Addi-
              tional file(1,n) formats unspecified  by  this  volume  of  IEEE  Std
              1003.1-2001 may impose restrictions on appending.

       -b blocksize
              Block  the  output at a positive decimal integer number of bytes
              per write(1,2) to the archive file. Devices and archive  formats  may
              impose restrictions on blocking. Blocking shall be automatically
              determined on input. Conforming applications shall not specify a
              blocksize value larger than 32256.  Default blocking when creat-
              ing archives depends on the archive format. (See the  -x  option
              below.)

       -c     Match  all file(1,n) or archive members except those specified by the
              pattern or file(1,n) operands.

       -d     Cause files of type directory being copied or  archived  or  ar-
              chive  members  of  type  directory being extracted or listed to
              match only the file(1,n) or archive member itself and  not  the  file(1,n)
              hierarchy rooted at the file.

       -f archive
              Specify  the pathname of the input or output archive, overriding
              the default standard input (in(1,8) list or read(2,n,1 builtins) modes)  or  standard
              output (write(1,2) mode).

       -H     If a symbolic link(1,2) referencing a file(1,n) of type directory is spec-
              ified on the command line, pax shall archive the file(1,n)  hierarchy
              rooted in(1,8) the file(1,n) referenced by the link(1,2), using the name of the
              link(1,2) as the root of the file(1,n) hierarchy.  Otherwise,  if(3,n)  a  sym-
              bolic  link(1,2)  referencing a file(1,n) of any other file(1,n) type which pax
              can normally archive is specified on the command line, then  pax
              shall archive the file(1,n) referenced by the link(1,2), using the name of
              the link. The default behavior shall be to archive the  symbolic
              link(1,2) itself.

       -i     Interactively  rename(1,2,n) files or archive members. For each archive
              member matching a pattern operand or file(1,n) matching a file(1,n)  oper-
              and, a prompt shall be written to the file(1,n) /dev/tty.  The prompt
              shall contain the name of the file(1,n) or archive  member,  but  the
              format  is otherwise unspecified. A line shall then be read(2,n,1 builtins) from
              /dev/tty. If this line is blank,  the  file(1,n)  or  archive  member
              shall  be skipped. If this line consists of a single period, the
              file(1,n) or archive member shall be processed with  no  modification
              to its name. Otherwise, its name shall be replaced with the con-
              tents of the line. The pax utility shall immediately exit(3,n,1 builtins) with a
              non-zero  exit(3,n,1 builtins) status if(3,n) end-of-file is encountered when reading
              a response or if(3,n) /dev/tty(1,4) cannot be opened for reading and writ-
              ing.

              The  results  of  extracting a hard link(1,2) to a file(1,n) that has been
              renamed during extraction are unspecified.

       -k     Prevent the overwriting of existing files.

       -l     (The letter ell.) In copy mode, hard links shall be made between
              the  source  and destination file(1,n) hierarchies whenever possible.
              If specified in(1,8) conjunction with -H or -L, when a symbolic  link(1,2)
              is  encountered,  the  hard link(1,2) created in(1,8) the destination file(1,n)
              hierarchy shall be to the file(1,n) referenced by the symbolic  link.
              If  specified  when  neither -H nor -L is specified, when a sym-
              bolic link(1,2) is encountered, the  implementation  shall  create  a
              hard  link(1,2)  to the symbolic link(1,2) in(1,8) the source file(1,n) hierarchy or
              copy the symbolic link(1,2) to the destination.

       -L     If a symbolic link(1,2) referencing a file(1,n) of type directory is spec-
              ified on the command line or encountered during the traversal of
              a file(1,n) hierarchy, pax shall archive the file(1,n) hierarchy rooted in(1,8)
              the  file(1,n)  referenced by the link(1,2), using the name of the link(1,2) as
              the root of the file(1,n) hierarchy.  Otherwise, if(3,n) a  symbolic  link(1,2)
              referencing a file(1,n) of any other file(1,n) type which pax can normally
              archive is specified on the command line or  encountered  during
              the  traversal  of  a file(1,n) hierarchy, pax shall archive the file(1,n)
              referenced by the link(1,2), using the name of the link. The  default
              behavior shall be to archive the symbolic link(1,2) itself.

       -n     Select  the first archive member that matches each pattern oper-
              and. No more than one archive member shall be matched  for  each
              pattern  (although  members  of type directory shall still match
              the file(1,n) hierarchy rooted at that file(1,n)).

       -o options
              Provide information to the implementation to  modify  the  algo-
              rithm  for  extracting  or  writing  files. The value of options
              shall consist of one or more  comma-separated  keywords  of  the
              form:

              keyword[[:]=value][,keyword[[:]=value],...]

              Some  keywords  apply only to certain file(1,n) formats, as indicated
              with each description. Use of keywords that are inapplicable  to
              the file(1,n) format being processed produces undefined results.

              Keywords in(1,8) the options argument shall be a string(3,n) that would be
              a valid portable filename as described in(1,8) the  Base  Definitions
              volume of IEEE Std 1003.1-2001, Section 3.276, Portable Filename
              Character Set.

              Note:  Keywords are not expected to be filenames, merely to fol-
                     low  the  same  character  composition  rules as portable
                     filenames.

              Keywords can be preceded with white space. The value field shall
              consist  of  zero or more characters; within value, the applica-
              tion shall precede any literal comma  with  a  backslash,  which
              shall  be  ignored,  but preserves the comma as part of value. A
              comma as the final character, or  a  comma  followed  solely  by
              white  space  as  the  final  characters,  in(1,8)  options  shall be
              ignored. Multiple -o options can be specified; if(3,n) keywords given
              to  these  multiple -o options conflict, the keywords and values
              appearing later in(1,8) command line sequence shall  take  precedence
              and the earlier shall be silently ignored. The following keyword
              values of options shall be supported for  the  file(1,n)  formats  as
              indicated:

              delete=pattern
                     (Applicable  only  to  the  -x  pax format.) When used in(1,8)
                     write(1,2) or copy mode, pax shall omit from  extended  header
                     records that it produces any keywords matching the string(3,n)
                     pattern. When used in(1,8) read(2,n,1 builtins) or list mode, pax shall ignore
                     any  keywords matching the string(3,n) pattern in(1,8) the extended
                     header records. In both cases,  matching  shall  be  per-
                     formed  using  the pattern matching notation described in(1,8)
                     Patterns Matching a Single Character and Patterns  Match-
                     ing Multiple Characters. For example:

                     -o delete=security.*

                     would  suppress  security-related  information.  See  pax
                     Extended Header for extended header record keyword usage.

                     When  multiple  -o  delete=pattern options are specified,
                     the patterns shall be additive; all keywords matching the
                     specified  string(3,n) patterns shall be omitted from extended
                     header records that pax produces.

              exthdr.name=string(3,n)
                     (Applicable only to the  -x  pax  format.)  This  keyword
                     allows  user  control  over the name that is written into
                     the ustar header blocks for the extended header  produced
                     under  the  circumstances  described in(1,8) pax Header Block.
                     The name shall be the contents of string(3,n), after the  fol-
                     lowing character substitutions have been made:


                  +-----------------+---------------------------------------------+
                  |string(3,n) Includes: | Replaced By:                                |
                  +-----------------+---------------------------------------------+
                  |%d               | The directory name of the file(1,n), equivalent  |
                  |                 | to the result of the dirname utility on the |
                  |                 | translated pathname.                        |
                  +-----------------+---------------------------------------------+
                  |%f               | The filename of the file(1,n), equivalent to the |
                  |                 | result of the basename(1,3,3 File::Basename) utility on the       |
                  |                 | translated pathname.                        |
                  +-----------------+---------------------------------------------+
                  |%p               | The process ID of the pax process.          |
                  +-----------------+---------------------------------------------+
                  |%%               | A '%' character.                            |
                  +-----------------+---------------------------------------------+
                     Any  other  '%'  characters  in(1,8)  string(3,n) produce undefined
                     results.

                     If no -o exthdr.name= string(3,n) is specified, pax shall  use
                     the following default value:

                             %d/PaxHeaders.%p/%f


              globexthdr.name=string(3,n)
                     (Applicable  only  to  the  -x  pax format.) When used in(1,8)
                     write(1,2) or copy mode  with  the  appropriate  options,  pax
                     shall  create  global  extended header records with ustar
                     header blocks that will be treated as  regular  files  by
                     previous  versions of pax.  This keyword allows user con-
                     trol over the name that is written into the ustar  header
                     blocks for global extended header records. The name shall
                     be the contents of string(3,n), after the following  character
                     substitutions have been made:


                  +-----------------+---------------------------------------------+
                  |string(3,n) Includes: | Replaced By:                                |
                  +-----------------+---------------------------------------------+
                  |%n               | An integer that represents the sequence     |
                  |                 | number of the global extended header record |
                  |                 | in(1,8) the archive, starting at 1.              |
                  +-----------------+---------------------------------------------+
                  |%p               | The process ID of the pax process.          |
                  +-----------------+---------------------------------------------+
                  |%%               | A '%' character.                            |
                  +-----------------+---------------------------------------------+
                     Any  other  '%'  characters  in(1,8)  string(3,n) produce undefined
                     results.

                     If no -o globexthdr.name=string(3,n) is specified,  pax  shall
                     use the following default value:

                     $TMPDIR/GlobalHead.%p.%n

                     where $TMPDIR represents the value of the TMPDIR environ-
                     ment variable. If TMPDIR is not set(7,n,1 builtins), pax shall use  /tmp.

              invalid=action
                     (Applicable  only  to  the  -x  pax format.) This keyword
                     allows user  control  over  the  action  pax  takes  upon
                     encountering values in(1,8) an extended header record that, in(1,8)
                     read(2,n,1 builtins) or copy mode, are invalid in(1,8) the destination hierar-
                     chy  or,  in(1,8)  list mode, cannot be written in(1,8) the codeset
                     and current locale(3,5,7) of the implementation.  The  following
                     are invalid values that shall be recognized by pax:

                     +      In read(2,n,1 builtins) or copy mode, a filename or link(1,2) name that
                            contains character encodings invalid in(1,8) the desti-
                            nation  hierarchy. (For example, the name may con-
                            tain embedded NULs.)

                     +      In read(2,n,1 builtins) or copy mode, a filename or link(1,2) name that
                            is longer than the maximum allowed in(1,8) the destina-
                            tion hierarchy (for either a pathname component or
                            the entire pathname).

                     +      In  list  mode,  any character string(3,n) value (file-
                            name, link(1,2) name, user name, and so on) that cannot
                            be  written  in(1,8)  the codeset and current locale(3,5,7) of
                            the implementation.

                     The following mutually-exclusive  values  of  the  action
                     argument are supported:

                     bypass In  read(2,n,1 builtins)  or copy mode, pax shall bypass the file(1,n),
                            causing no change to the destination hierarchy. In
                            list  mode,  pax  shall  write(1,2) all requested valid
                            values for the file(1,n), but its  method  for  writing
                            invalid values is unspecified.

                     rename(1,2,n) In  read(2,n,1 builtins)  or copy mode, pax shall act as if(3,n) the -i
                            option were in(1,8) effect for each file(1,n)  with  invalid
                            filename or link(1,2) name values, allowing the user to
                            provide a replacement name interactively. In  list
                            mode,  pax  shall behave identically to the bypass
                            action.

                     UTF-8  When used in(1,8) read(2,n,1 builtins), copy, or list mode and a  file-
                            name, link(1,2) name, owner name, or any other field in(1,8)
                            an extended header  record  cannot  be  translated
                            from  the  pax UTF-8 codeset format to the codeset
                            and current  locale(3,5,7)  of  the  implementation,  pax
                            shall  use the actual UTF-8 encoding(3,n) for the name.

                     write(1,2)  In read(2,n,1 builtins) or copy mode, pax shall  write(1,2)  the  file(1,n),
                            translating  the  name, regardless of whether this
                            may overwrite an existing file(1,n) with a valid  name.
                            In  list mode, pax shall behave identically to the
                            bypass action.

                     If no -o invalid=option is specified, pax shall act as if(3,n)
                     -o  invalid=  bypass  were  specified. Any overwriting of
                     existing files that may be allowed  by  the  -o  invalid=
                     actions  shall be subject to permission(-p) and modifica-
                     tion time(1,2,n) (-u) restrictions, and shall be  suppressed  if(3,n)
                     the -k option is also specified.

              linkdata
                     (Applicable  only  to  the -x pax format.) In write(1,2) mode,
                     pax shall write(1,2) the contents of a  file(1,n)  to  the  archive
                     even when that file(1,n) is merely a hard link(1,2) to a file(1,n) whose
                     contents have already been written to the archive.

              listopt=format
                     This keyword specifies the output format of the table  of
                     contents produced when the -v option is specified in(1,8) list
                     mode. See List Mode Format Specifications. To avoid ambi-
                     guity,  the  listopt=  format  shall be the only or final
                     keyword= value pair in(1,8) a -o option-argument; all  charac-
                     ters  in(1,8)  the  remainder  of the option-argument shall be
                     considered part of the format string.  When  multiple  -o
                     listopt= format options are specified, the format strings
                     shall be considered a single, concatenated string(3,n), evalu-
                     ated in(1,8) command line order.

              times  (Applicable  only  to  the  -x  pax format.) When used in(1,8)
                     write(1,2) or copy mode, pax shall  include  atime  and  mtime
                     extended  header  records for each file. See pax Extended
                     Header File Times.

              In addition to these keywords, if(3,n) the -x pax  format  is  speci-
              fied,  any  of  the  keywords and values defined in(1,8) pax Extended
              Header, including implementation extensions, can be used  in(1,8)  -o
              option-arguments, in(1,8) either of two modes:

              keyword=value
                     When  used  in(1,8)  write(1,2)  or  copy mode, these keyword/value
                     pairs shall be included at the beginning of  the  archive
                     as  typeflag  g global extended header records. When used
                     in(1,8) read(2,n,1 builtins) or list mode, these keyword/value pairs shall act
                     as  if(3,n)  they  had been at the beginning of the archive as
                     typeflag g global extended header records.

              keyword:=value
                     When used in(1,8) write(1,2)  or  copy  mode,  these  keyword/value
                     pairs  shall be included as records at the beginning of a
                     typeflag x extended header for each file. (This shall  be
                     equivalent  to the equal-sign form except that it creates
                     no typeflag g global extended header records.) When  used
                     in(1,8) read(2,n,1 builtins) or list mode, these keyword/value pairs shall act
                     as if(3,n) they were included as records at the  end  of  each
                     extended  header; thus, they shall override any global or
                     file-specific extended header record keywords of the same
                     names. For example, in(1,8) the command:

                     pax -r -o "gname:=mygroup," <archive

                     the  group  name  will  be  forced to a new value for all
                     files read(2,n,1 builtins) from the archive.

              The precedence of -o keywords over various fields in(1,8) the archive
              is described in(1,8) pax Extended Header Keyword Precedence.

       -p string(3,n)
              Specify  one  or  more file(1,n) characteristic options (privileges).
              The string(3,n) option-argument shall be  a  string(3,n)  specifying  file(1,n)
              characteristics  to be retained or discarded on extraction.  The
              string(3,n) shall consist of the specification characters a ,  e,  m,
              o,   and  p.  Other  implementation-defined  characters  can  be
              included. Multiple characteristics can  be  concatenated  within
              the  same  string(3,n)  and multiple -p options can be specified. The
              meaning of the specification characters are as follows:

              a      Do not preserve file(1,n) access(2,5) times.

              e      Preserve the user ID, group ID, file(1,n) mode bits  (see  the
                     Base  Definitions volume of IEEE Std 1003.1-2001, Section
                     3.168, File Mode Bits), access(2,5) time(1,2,n),  modification  time(1,2,n),
                     and  any  other  implementation-defined file(1,n) characteris-
                     tics.

              m       Do not preserve file(1,n) modification times.

              o      Preserve the user ID and group ID.

              p      Preserve the file(1,n) mode bits. Other implementation-defined
                     file(1,n) mode attributes may be preserved.

              In  the  preceding  list, "preserve" indicates that an attribute
              stored in(1,8) the archive shall be given to the extracted file(1,n), sub-
              ject  to the permissions of the invoking process. The access(2,5) and
              modification times of the file(1,n) shall be preserved unless  other-
              wise  specified with the -p option or not stored in(1,8) the archive.
              All attributes that are not preserved  shall  be  determined  as
              part  of  the normal file(1,n) creation action (see File Read, Write,
              and Creation).

              If neither the e nor the o specification character is specified,
              or  the  user  ID and group ID are not preserved for any reason,
              pax shall not set(7,n,1 builtins) the S_ISUID and S_ISGID bits of the file(1,n) mode.

              If  the preservation of any of these items fails for any reason,
              pax shall write(1,2) a diagnostic message to standard error.  Failure
              to  preserve these items shall affect the final exit(3,n,1 builtins) status, but
              shall not cause the extracted file(1,n) to be deleted.

              If file(1,n) characteristic letters in(1,8) any of the string(3,n) option-argu-
              ments are duplicated or conflict with each other, the ones given
              last shall take precedence. For example, if(3,n) -p eme is specified,
              file(1,n) modification times are preserved.

       -s replstr
              Modify file(1,n) or archive member names named(5,8) by pattern or file(1,n) op-
              erands according to the substitution expression  replstr,  using
              the  syntax  of  the  ed  utility. The concepts of "address" and
              "line" are meaningless in(1,8) the context of the  pax  utility,  and
              shall not be supplied. The format shall be:

              -s /old/new/[gp]

              where  as  in(1,8)  ed, old is a basic regular expression and new can
              contain an ampersand, '0 (where n is a digit) backreferences, or
              subexpression  matching.  The old string(3,n) shall also be permitted
              to contain <newline>s.

              Any non-null character can be used as a delimiter  (  '/'  shown
              here). Multiple -s expressions can be specified; the expressions
              shall be applied in(1,8) the order specified,  terminating  with  the
              first  successful  substitution. The optional trailing 'g' is as
              defined in(1,8) the ed utility. The optional trailing 'p' shall cause
              successful  substitutions  to be written to standard error. File
              or archive member names that  substitute  to  the  empty  string(3,n)
              shall be ignored when reading and writing archives.

       -t     When reading files from the file(1,n) system, and if(3,n) the user has the
              permissions required by utime() to do so, set(7,n,1 builtins) the access(2,5) time(1,2,n) of
              each  file(1,n) read(2,n,1 builtins) to the access(2,5) time(1,2,n) that it had before being read(2,n,1 builtins)
              by pax.

       -u     Ignore files that are older (having a less(1,3) recent file(1,n) modifica-
              tion  time(1,2,n))  than a pre-existing file(1,n) or archive member with the
              same name. In read(2,n,1 builtins) mode, an archive member with the same name as
              a file(1,n) in(1,8) the file(1,n) system shall be extracted if(3,n) the archive mem-
              ber is newer than the file. In write(1,2) mode, an archive file(1,n)  mem-
              ber  with  the  same  name as a file(1,n) in(1,8) the file(1,n) system shall be
              superseded if(3,n) the file(1,n) is newer than the archive member.  If  -a
              is  also specified, this is accomplished by appending to the ar-
              chive; otherwise, it is unspecified whether this is accomplished
              by  actual replacement in(1,8) the archive or by appending to the ar-
              chive. In copy mode, the file(1,n) in(1,8) the destination hierarchy shall
              be  replaced by the file(1,n) in(1,8) the source hierarchy or by a link(1,2) to
              the file(1,n) in(1,8) the source hierarchy if(3,n) the file(1,n) in(1,8) the source hier-
              archy is newer.

       -v     In  list mode, produce a verbose table of contents (see the STD-
              OUT section). Otherwise, write(1,2) archive member pathnames to stan-
              dard error(8,n) (see the STDERR section).

       -x format
              Specify the output archive format. The pax utility shall support
              the following formats:

              cpio   The cpio interchange format; see the EXTENDED DESCRIPTION
                     section.  The default blocksize for this format for char-
                     acter special archive files shall  be  5120.  Implementa-
                     tions  shall  support  all  blocksize values less(1,3) than or
                     equal to 32256 that are multiples of 512.

              pax    The pax interchange format; see the EXTENDED  DESCRIPTION
                     section.  The default blocksize for this format for char-
                     acter special archive files shall be  5120.   Implementa-
                     tions  shall  support  all  blocksize values less(1,3) than or
                     equal to 32256 that are multiples of 512.

              ustar  The tar interchange format; see the EXTENDED  DESCRIPTION
                     section.  The default blocksize for this format for char-
                     acter special archive files shall be 10240.   Implementa-
                     tions  shall  support  all  blocksize values less(1,3) than or
                     equal to 32256 that are multiples of 512.

              Implementation-defined formats shall  specify  a  default  block
              size  as  well  as any other block sizes supported for character
              special archive files.

              Any attempt to append to an archive file(1,n) in(1,8) a  format  different
              from the existing archive format shall cause pax to exit(3,n,1 builtins) immedi-
              ately with a non-zero exit(3,n,1 builtins) status.

              In copy mode, if(3,n) no -x format is specified, pax shall behave  as
              if(3,n) -x pax were specified.

       -X     When  traversing the file(1,n) hierarchy specified by a pathname, pax
              shall not descend into directories that have a different  device
              ID  (  st_dev;  see  the  System  Interfaces  volume of IEEE Std
              1003.1-2001, stat(1,2)()).

       Specifying more than one of the mutually-exclusive options  -H  and  -L
       shall  not  be  considered an error(8,n) and the last option specified shall
       determine the behavior of the utility.

       The options that operate on the names of files or archive members  (-c,
       -i,  -n, -s, -u, and -v)shallinteractasfollows.Inread(2,n,1 builtins) mode, the archive
       members shall be selected based on the user-specified pattern  operands
       as  modified by the -c, -n, and -u options. Then, any -s and -i options
       shall modify, in(1,8) that order, the names of the selected  files.  The  -v
       option shall write(1,2) names resulting from these modifications.

       In  write(1,2) mode, the files shall be selected based on the user-specified
       pathnames as modified by the -n and -u options.  Then, any  -s  and  -i
       options shall modify, in(1,8) that order, the names of these selected files.
       The -v option shall write(1,2) names resulting from these modifications.

       If both the -u and -n options are specified, pax shall not  consider  a
       file(1,n) selected unless it is newer than the file(1,n) to which it is compared.


   List Mode Format Specifications
       The manual page for spax is not yet ready.  The  following  text  is  a
       quotation from the POSIX.1-2001 standard.

       In  list  mode  with  the -o listopt=format option, the format argument
       shall be applied for each selected file. The pax utility shall append a
       <newline>  to  the  listopt  output  for each selected file. The format
       argument shall be used as the format string(3,n) described in(1,8) the Base Defi-
       nitions  volume  of  IEEE Std 1003.1-2001, Chapter 5, File Format Nota-
       tion, with the exceptions  1.  through  5.   defined  in(1,8)  the  EXTENDED
       DESCRIPTION section of printf(1,3,1 builtins)(3), plus the following exceptions:

       6.     The  sequence  (keyword)  can  occur  before a format conversion
              specifier. The conversion argument is defined by  the  value  of
              keyword.   The  implementation  shall support the following key-
              words:

                    Any of the Field Name entries in(1,8) ustar Header  Block  and
                     Octet-Oriented cpio Archive Entry. The implementation may
                     support the cpio keywords without the leading c_ in(1,8) addi-
                     tion  to  the  form  required  by  Values for cpio c_mode
                     Field.

                    Any keyword  defined  for  the  extended  header  in(1,8)  pax
                     Extended Header.

                    Any  keyword provided as an implementation-defined exten-
                     sion within the extended header defined in(1,8)  pax  Extended
                     Header.

              For  example,  the sequence "%(charset)s" is the string(3,n) value of
              the name of the character set(7,n,1 builtins) in(1,8) the extended header.

              The result of the keyword conversion argument shall be the value
              from the applicable header field or extended header, without any
              trailing NULs.

              All keyword values used as conversion arguments shall be  trans-
              lated  from  the UTF-8 encoding(3,n) to the character set(7,n,1 builtins) appropriate
              for the local file(1,n) system, user database, and so on, as applica-
              ble.

       7.     An  additional  conversion specifier character, T, shall be used
              to specify time(1,2,n) formats. The T  conversion  specifier  character
              can  be preceded by the sequence (keyword=subformat), where sub-
              format is a date format as defined by date operands. The default
              keyword shall be mtime and the default subformat shall be:

                 %b %e %H:%M %Y


       8.     An  additional  conversion specifier character, M, shall be used
              to specify the file(1,n) mode string(3,n) as  defined  in(1,8)  ls(1)  Standard
              Output. If (keyword) is omitted, the mode keyword shall be used.
              For example, %.1M writes the single character  corresponding  to
              the <entry type> field of the ls -l command.

       9.     An  additional  conversion specifier character, D, shall be used
              to specify the device for block or special files, if(3,n) applicable,
              in(1,8)  an  implementation-defined  format.  If  not applicable, and
              (keyword) is specified, then this conversion shall be equivalent
              to  %(keyword)u.   If  not applicable, and (keyword) is omitted,
              then this conversion shall be equivalent to <space>.

       10.    An additional conversion specifier character, F, shall  be  used
              to  specify  a  pathname. The F conversion character can be pre-
              ceded by a sequence of comma-separated keywords:

                 (keyword[,keyword] ... )
              The values for all the keywords that are non-null shall be  con-
              catenated  together,  each separated by a '/'. The default shall
              be (path) if(3,n) the keyword path is defined; otherwise, the default
              shall be (prefix, name).

       11.    An  additional  conversion specifier character, L, shall be used
              to specify a symbolic line expansion. If the current file(1,n)  is  a
              symbolic link(1,2), then %L shall expand to:

                 "%s -> %s", <value of keyword>, <contents of link(1,2)>

       Otherwise,  the  %L conversion specification shall be the equivalent of
       %F.


OPERANDS
       The following operands shall be supported:

       directory
              The destination directory pathname for copy mode.

       file(1,n)   A pathname of a file(1,n) to be copied or archived.

       pattern
              A pattern matching one or more pathnames of archive members.   A
              pattern  must  be  given  in(1,8) the name-generating notation of the
              pattern matching notation in(1,8) Pattern Matching Notation , includ-
              ing  the  filename expansion rules in(1,8) Patterns Used for Filename
              Expansion. The default, if(3,n) no pattern is specified, is to select(2,7,2 select_tut)
              all members in(1,8) the archive.


STDIN
       In  write(1,2)  mode, the standard input shall be used only if(3,n) no file(1,n) oper-
       ands are specified. It shall be a text file(1,n) containing a list of  path-
       names, one per line, without leading or trailing <blank>s.

       In  list  and  read(2,n,1 builtins)  modes,  if(3,n) -f is not specified, the standard input
       shall be an archive file.

       Otherwise, the standard input shall not be used.


INPUT FILES
       The input file(1,n) named(5,8) by the archive option-argument, or standard  input
       when  the archive is read(2,n,1 builtins) from there, shall be a file(1,n) formatted accord-
       ing to one of the specifications in(1,8) the EXTENDED DESCRIPTION section or
       some other implementation-defined format.

       The file(1,n) /dev/tty(1,4) shall be used to write(1,2) prompts and read(2,n,1 builtins) responses.


ENVIRONMENT VARIABLES
       The following environment variables shall affect the execution of pax:

       LANG   Provide  a  default value for the internationalization variables
              that are unset or null. (See the Base Definitions volume of IEEE
              Std 1003.1-2001, Section 8.2, Internationalization Variables for
              the precedence of internationalization variables used to  deter-
              mine the values of locale(3,5,7) categories.)

       LC_ALL If  set(7,n,1 builtins)  to a non-empty string(3,n) value, override the values of all
              the other internationalization variables.

       LC_COLLATE
              Determine the locale(3,5,7) for the  behavior  of  ranges,  equivalence
              classes, and multi-character collating elements used in(1,8) the pat-
              tern matching expressions for the  pattern  operand,  the  basic
              regular  expression  for the -s option, and the extended regular
              expression defined for the yesexpr locale(3,5,7) keyword in(1,8) the LC_MES-
              SAGES category.

       LC_CTYPE
              Determine  the  locale(3,5,7)  for  the  interpretation of sequences of
              bytes of text data as characters (for  example,  single-byte  as
              opposed  to multi-byte characters in(1,8) arguments and input files),
              the behavior of character classes used in(1,8) the  extended  regular
              expression defined for the yesexpr locale(3,5,7) keyword in(1,8) the LC_MES-
              SAGES category, and pattern matching.

       LC_MESSAGES
              Determine the locale(3,5,7) for the processing of affirmative responses
              that  should  be used to affect the format and contents of diag-
              nostic messages written to standard error.

       LC_TIME
              Determine the format and contents of date and time(1,2,n) strings  when
              the -v option is specified.

       NLSPATH
              [XSI]  [Option Start] Determine the location of message catalogs
              for the processing of LC_MESSAGES . [Option End]

       TMPDIR Determine the pathname that provides part of the default  global
              extended header record file(1,n), as described for the -o globexthdr=
              keyword in(1,8) the OPTIONS section.

       TZ     Determine the timezone used to calculate date and  time(1,2,n)  strings
              when  the  -v  option  is  specified. If TZ is unset or null, an
              unspecified default timezone shall be used.


ASYNCHRONOUS EVENTS
       Default.


STDOUT
       In write(1,2) mode, if(3,n) -f is not specified, the standard output shall be the
       archive  formatted  according  to  one  of  the  specifications  in(1,8) the
       EXTENDED DESCRIPTION section, or some other implementation-defined for-
       mat (see -x format).

       In  list  mode,  when  the  -o  listopt= format has been specified, the
       selected archive members shall be written to standard output using  the
       format  described  under  List Mode Format Specifications. In list mode
       without the -o listopt= format option, the table  of  contents  of  the
       selected  archive members shall be written to standard output using the
       following format:

            "%s0, <pathname>

       If the -v option is specified in(1,8) list mode, the table  of  contents  of
       the  selected archive members shall be written to standard output using
       the following formats.

       For pathnames representing hard links to previous members  of  the  ar-
       chive:

            "%s == %s0, <ls -l listing>, <linkname>

       For all other pathnames:

            "%s0, <ls -l listing>

       where  <ls -l listing> shall be the format specified by the ls(1) util-
       ity with the -l option. When writing pathnames in(1,8) this  format,  it  is
       unspecified what is written for fields for which the underlying archive
       format does not have the correct information, although the correct num-
       ber of <blank>-separated fields shall be written.

       In list mode, standard output shall not be buffered more than a line at
       a time.


STDERR
       If -v is specified in(1,8) read(2,n,1 builtins), write(1,2), or copy modes, pax shall  write(1,2)  the
       pathnames it processes to the standard error(8,n) output using the following
       format:

            "%s0, <pathname>

       These pathnames shall be written as soon as processing is begun on  the
       file(1,n)  or  archive  member,  and shall be flushed to standard error. The
       trailing <newline>, which shall not be buffered, is  written  when  the
       file(1,n) has been read(2,n,1 builtins) or written.

       If  the -s option is specified, and the replacement string(3,n) has a trail-
       ing 'p', substitutions shall be written to standard error(8,n) in(1,8)  the  fol-
       lowing format:

            "%s >> %s0, <original pathname>, <new pathname>

       In  all operating modes of pax, optional messages of unspecified format
       concerning the input archive format and volume number,  the  number  of
       files,  blocks,  volumes,  and  media parts as well as other diagnostic
       messages may be written to standard error.

       In all formats, for both standard output  and  standard  error(8,n),  it  is
       unspecified how non-printable characters in(1,8) pathnames or link(1,2) names are
       written.

       When pax is in(1,8) read(2,n,1 builtins) mode or list mode, using the -x pax archive format,
       and  a  filename,  link(1,2)  name,  owner  name,  or  any other field in(1,8) an
       extended header record cannot be translated from the pax UTF-8  codeset
       format  to  the  codeset  and current locale(3,5,7) of the implementation, pax
       shall write(1,2) a diagnostic message to standard error(8,n), shall  process  the
       file(1,n)  as  described  for the -o invalid= option, and then shall process
       the next file(1,n) in(1,8) the archive.


OUTPUT FILES
       In read(2,n,1 builtins) mode, the extracted output files shall be of the archived  file(1,n)
       type.  In  copy  mode, the copied output files shall be the type of the
       file(1,n) being copied. In either mode, existing files  in(1,8)  the  destination
       hierarchy shall be overwritten only when all permission (-p), modifica-
       tion time(1,2,n) (-u), and invalid-value (-o invalid=) tests allow it.

       In write(1,2) mode, the output file(1,n) named(5,8) by the -f option-argument shall be
       a file(1,n) formatted according to one of the specifications in(1,8) the EXTENDED
       DESCRIPTION section, or some other implementation-defined format.


EXTENDED DESCRIPTION
   pax Interchange Format
       A pax archive tape or file(1,n) produced in(1,8) the -x pax format shall  contain
       a series of blocks. The physical layout of the archive shall be identi-
       cal to the ustar format described in(1,8)  ustar  Interchange  Format.  Each
       file(1,n) archived shall be represented by the following sequence:

                    An  optional  header  block with extended header records.
                     This header block is of the form described in(1,8) pax  Header
                     Block,  with  a  typeflag  value of x or g.  The extended
                     header records, described in(1,8) pax Extended  Header,  shall
                     be included as the data for this header block.

                    A header block that describes the file. Any fields in(1,8) the
                     preceding optional extended  header  shall  override  the
                     associated fields in(1,8) this header block for this file.

                    Zero  or  more  blocks  that  contain the contents of the
                     file.

       At the end of the archive file(1,n)  there  shall  be  two  512-byte  blocks
       filled with binary zeros, interpreted as an end-of-archive indicator.

       A  schematic  of an example archive with global extended header records
       and two actual files is shown in(1,8) pax Format  Archive  Example.  In  the
       example,  the second file(1,n) in(1,8) the archive has no extended header preced-
       ing it, presumably because it has no need for extended attributes.


    +------------------------------+---------------------------------------------+
    |ustar Header [typeflag = 'g'] |                                             |
    +------------------------------+           Global Extended header            |
    |Global Extended Header Data   |                                             |
    +------------------------------+---------------------------------------------+
    |ustar Header [typeflag = 'x'] |                                             |
    +------------------------------+                                             |
    |Extended Header Data          |                                             |
    +------------------------------+  File 1: Extended Header data is included   |
    |ustar Header [typeflag = '0'] |                                             |
    +------------------------------+                                             |
    |Data for File 1               |                                             |
    +------------------------------+---------------------------------------------+
    |ustar Header [typeflag = '0'] |                                             |
    +------------------------------+ File 2: No Extended Header data is included |
    |Data for File 2               |                                             |
    +------------------------------+---------------------------------------------+
    |Block of binary Zeroes        |                                             |
    +------------------------------+          End of Archive Indicator           |
    |Block of binary Zeroes        |                                             |
    +------------------------------+---------------------------------------------+
                         Figure: pax Format Archive Example


   pax Header Block
       The pax header block shall be  identical  to  the  ustar  header  block
       described in(1,8) ustar Interchange Format, except that two additional type-
       flag values are defined:

       x      Represents extended header records for the following file(1,n) in(1,8) the
              archive (which shall have its own ustar header block).  The for-
              mat of these extended header records shall be  as  described  in(1,8)
              pax Extended Header.

       g      Represents  global  extended  header  records  for the following
              files in(1,8) the  archive.  The  format  of  these  extended  header
              records  shall  be  as  described  in(1,8) pax Extended Header.  Each
              value shall affect all subsequent files  that  do  not  override
              that value in(1,8) their own extended header record and until another
              global extended header record is reached that  provides  another
              value  for  the same field. The typeflag g global headers should
              not be used with interchange media  that  could  suffer  partial
              data loss in(1,8) transporting the archive.

       For  both  of  these  types,  the  size  field shall be the size of the
       extended header records in(1,8) octets. The other fields in(1,8) the header block
       are  not  meaningful  to  this version(1,3,5) of the pax utility.  However, if(3,n)
       this  archive  is  read(2,n,1 builtins)  by  a  pax  utility  conforming  to  the   ISO
       POSIX-2:1993  standard,  the  header  block fields are used to create a
       regular file(1,n) that contains the extended header records as data.  There-
       fore,  header  block field values should be selected to provide reason-
       able file(1,n) access(2,5) to this regular file.

       A further difference from the ustar header block is  that  data  blocks
       for  files  of  typeflag 1 (the digit one) (hard link(1,2)) may be included,
       which means that the size field may be greater than zero. Archives cre-
       ated  by  pax -o linkdata shall include these data blocks with the hard
       links.


   pax Extended Header
       A pax extended header contains values that are  inappropriate  for  the
       ustar  header  block  because  of  limitations  in(1,8)  that format: fields
       requiring a character encoding(3,n) other than that described in(1,8) the ISO/IEC
       646:1991 standard, fields representing file(1,n) attributes not described in(1,8)
       the ustar header, and fields whose format or  length  do  not  fit  the
       requirements  of the ustar header. The values in(1,8) an extended header add
       attributes to the following file(1,n) (or files; see the description of  the
       typeflag  g  header  block)  or override values in(1,8) the following header
       block(s), as indicated in(1,8) the following list of keywords.

       An extended header shall consist of one  or  more  records,  each  con-
       structed as follows:

            "%d %s=%s0, <length>, <keyword>, <value>

       The  extended  header records shall be encoded according to the ISO/IEC
       10646-1:2000 standard (UTF-8).  The  <length>  field,  <blank>,  equals
       sign,  and  <newline>  shown shall be limited to the portable character
       set(7,n,1 builtins), as encoded in(1,8) UTF-8. The <keyword> and <value> fields can  be  any
       UTF-8 characters. The <length> field shall be the decimal length of the
       extended header record in(1,8) octets, including the trailing <newline>.

       The <keyword> field shall be one of the entries from the following list
       or  a  keyword  provided as an implementation extension.  Keywords con-
       sisting entirely of lowercase letters, digits, and periods are reserved
       for future standardization. A keyword shall not include an equals sign.
       (In the following list, the notations "file(1,n)(s)" or "block(s)"  is  used
       to acknowledge that a keyword affects the following single file(1,n) after a
       typeflag x extended header, but possibly multiple files after  typeflag
       g.   Any  requirements  in(1,8) the list for pax to include a record when in(1,8)
       write(1,2) or copy mode shall apply only when such a record has not  already
       been provided through the use of the -o option. When used in(1,8) copy mode,
       pax shall behave as if(3,n) an archive  had  been  created  with  applicable
       extended header records and then extracted.)

       atime  The  file(1,n)  access(2,5)  time(1,2,n) for the following file(1,n)(s), equivalent to
              the value of the st_atime member of the  stat(1,2)  structure  for  a
              file(1,n),  as  described  by  the  stat(1,2)(2) function. The access(2,5) time(1,2,n)
              shall be restored if(3,n) the process has the  appropriate  privilege
              required  to  do  so.  The  format  of  the  <value> shall be as
              described in(1,8) pax Extended Header File Times.

       charset
              The name of the character set(7,n,1 builtins) used to encode  the  data  in(1,8)  the
              following  file(1,n)(s).  The  entries  in(1,8)  the  following  table are
              defined to refer to known standards;  additional  names  may  be
              agreed on between the originator and recipient.


              +------------------------+-------------------------------+
              |        <value>         |        Formal Standard        |
              +------------------------+-------------------------------+
              |ISO-IR 646 1990         | ISO/IEC 646:1990              |
              |ISO-IR 8859 1 1998      | ISO/IEC 8859-1:1998           |
              |ISO-IR 8859 2 1999      | ISO/IEC 8859-2:1999           |
              |ISO-IR 8859 3 1999      | ISO/IEC 8859-3:1999           |
              |ISO-IR 8859 4 1998      | ISO/IEC 8859-4:1998           |
              |ISO-IR 8859 5 1999      | ISO/IEC 8859-5:1999           |
              |ISO-IR 8859 6 1999      | ISO/IEC 8859-6:1999           |
              |ISO-IR 8859 7 1987      | ISO/IEC 8859-7:1987           |
              |ISO-IR 8859 8 1999      | ISO/IEC 8859-8:1999           |
              |ISO-IR 8859 9 1999      | ISO/IEC 8859-9:1999           |
              |ISO-IR 8859 10 1998     | ISO/IEC 8859-10:1998          |
              |ISO-IR 8859 13 1998     | ISO/IEC 8859-13:1998          |
              |ISO-IR 8859 14 1998     | ISO/IEC 8859-14:1998          |
              |ISO-IR 8859 15 1999     | ISO/IEC 8859-15:1999          |
              |ISO-IR 10646 2000       | ISO/IEC 10646:2000            |
              |ISO-IR 10646 2000 UTF-8 | ISO/IEC 10646, UTF-8 encoding(3,n) |
              |BINARY                  | None                          |
              +------------------------+-------------------------------+
       The  encoding(3,n)  is  included in(1,8) an extended header for information only;
       when pax is used as described in(1,8) IEEE Std  1003.1-2001,  it  shall  not
       translate the file(1,n) data into any other encoding. The BINARY entry indi-
       cates unencoded binary data.

       When used in(1,8) write(1,2) or copy mode, it is  implementation-defined  whether
       pax includes a charset extended header record for a file.

       comment
              A  series of characters used as a comment. All characters in(1,8) the
              <value> field shall be ignored by pax.

       gid    The group ID of the group that owns the  file(1,n),  expressed  as  a
              decimal  number using digits from the ISO/IEC 646:1991 standard.
              This record shall override the gid field in(1,8) the following header
              block(s).  When  used in(1,8) write(1,2) or copy mode, pax shall include a
              gid extended header record for  each  file(1,n)  whose  group  ID  is
              greater than 2097151 (octal 7777777).

       gname  The group of the file(1,n)(s), formatted as a group name in(1,8) the group
              database. This record shall override the gid and gname fields in(1,8)
              the  following  header  block(s),  and  any  gid extended header
              record. When used in(1,8) read(2,n,1 builtins), copy, or list mode, pax shall  trans-
              late  the  name  from the UTF-8 encoding(3,n) in(1,8) the header record to
              the character set(7,n,1 builtins) appropriate for  the  group  database  on  the
              receiving  system.  If  any  of  the  UTF-8 characters cannot be
              translated, and if(3,n) the -o invalid=UTF-8 option is not specified,
              the  results  are  implementation-defined. When used in(1,8) write(1,2) or
              copy mode, pax shall include a gname extended header record  for
              each  file(1,n)  whose group name cannot be represented entirely with
              the letters and digits of the portable character set.

       linkpath
              The pathname of a link(1,2) being created to  another  file(1,n),  of  any
              type,  previously  archived.  This  record  shall  override  the
              linkname field in(1,8) the following ustar header block(s). The  fol-
              lowing  ustar header block shall determine the type of link(1,2) cre-
              ated. If typeflag of the following header block is 1,  it  shall
              be  a  hard  link. If typeflag is 2, it shall be a symbolic link(1,2)
              and the linkpath value shall be the  contents  of  the  symbolic
              link. The pax utility shall translate the name of the link(1,2) (con-
              tents of the symbolic link(1,2)) from the UTF-8 encoding(3,n) to the char-
              acter  set(7,n,1 builtins)  appropriate  for the local file(1,n) system. When used in(1,8)
              write(1,2) or copy mode, pax shall include a linkpath extended header
              record  for  each  link(1,2)  whose  pathname  cannot  be represented
              entirely with the members of the portable  character  set(7,n,1 builtins)  other
              than NUL.

       mtime  The  file(1,n) modification time(1,2,n) of the following file(1,n)(s), equivalent
              to the value of the st_mtime member of the stat(1,2) structure for  a
              file(1,n),  as  described in(1,8) the stat(1,2)(2) function.  This record shall
              override the mtime field in(1,8) the following header  block(s).  The
              modification  time(1,2,n)  shall  be  restored  if(3,n)  the process has the
              appropriate privilege required to do  so.   The  format  of  the
              <value> shall be as described in(1,8) pax Extended Header File Times.

       path   The pathname of the following file(1,n)(s). This record  shall  over-
              ride  the  name  and  prefix  fields  in(1,8)  the  following  header
              block(s). The pax utility shall translate the  pathname  of  the
              file(1,n)  from  the  UTF-8 encoding(3,n) to the character set(7,n,1 builtins) appropriate
              for the local file(1,n) system.

              When used in(1,8) write(1,2) or  copy  mode,  pax  shall  include  a  path
              extended  header  record  for each file(1,n) whose pathname cannot be
              represented entirely with the members of the portable  character
              set(7,n,1 builtins) other than NUL.

       realtime.any
              The  keywords  prefixed  by  "realtime." are reserved for future
              standardization.

       security.any
              The keywords prefixed by "security."  are  reserved  for  future
              standardization.

       size   The  size  of  the file(1,n) in(1,8) octets, expressed as a decimal number
              using digits from the ISO/IEC  646:1991  standard.  This  record
              shall  override the size field in(1,8) the following header block(s).
              When used in(1,8) write(1,2) or  copy  mode,  pax  shall  include  a  size
              extended  header  record for each file(1,n) with a size value greater
              than 8589934591 (octal 77777777777).

       uid    The user ID of the file(1,n) owner, expressed  as  a  decimal  number
              using  digits  from  the  ISO/IEC 646:1991 standard. This record
              shall override the uid field in(1,8) the following  header  block(s).
              When  used  in(1,8)  write(1,2)  or  copy  mode,  pax  shall include a uid
              extended header record for each file(1,n) whose owner ID  is  greater
              than 2097151 (octal 7777777).

       uname(1,2)  The  owner of the following file(1,n)(s), formatted as a user name in(1,8)
              the user database. This record shall override the uid and  uname(1,2)
              fields  in(1,8)  the  following header block(s), and any uid extended
              header record. When used in(1,8) read(2,n,1 builtins), copy, or list mode, pax  shall
              translate  the name from the UTF-8 encoding(3,n) in(1,8) the header record
              to the character set(7,n,1 builtins) appropriate for the user  database  on  the
              receiving  system.  If  any  of  the  UTF-8 characters cannot be
              translated, and if(3,n) the -o invalid=UTF-8 option is not specified,
              the  results  are  implementation-defined. When used in(1,8) write(1,2) or
              copy mode, pax shall include a uname(1,2) extended header record  for
              each  file(1,n)  whose  user name cannot be represented entirely with
              the letters and digits of the portable character set.

       If the <value> field is zero length, it shall delete any  header  block
       field,  previously  entered  extended  header value, or global extended
       header value of the same name.

       If a keyword in(1,8) an extended header record (or in(1,8) a -o  option-argument)
       overrides  or  deletes a corresponding field in(1,8) the ustar header block,
       pax shall ignore the contents of that header block field.

       Unlike the ustar header block fields, NULs shall not delimit  <value>s;
       all  characters  within  the <value> field shall be considered data for
       the field. None of the length limitations of  the  ustar  header  block
       fields  in(1,8)  ustar  Header  Block  shall  apply  to  the extended header
       records.


   pax Extended Header Keyword Precedence
       This section describes the  precedence  in(1,8)  which  the  various  header
       records  and fields and command line options are selected to apply to a
       file(1,n) in(1,8) the archive. When pax is used in(1,8) read(2,n,1 builtins) or list modes,  it  shall
       determine a file(1,n) attribute in(1,8) the following sequence:

              1.     If   -o   delete=keyword-prefix  is  used,  the  affected
                     attributes shall be determined from step 7., if(3,n)  applica-
                     ble, or ignored otherwise.

              2.     If -o keyword:= is used, the affected attributes shall be
                     ignored.

              3.     If -o keyword:=value  is  used,  the  affected  attribute
                     shall be assigned the value.

              4.     If  there  is  a  typeflag  x extended header record, the
                     affected attribute shall be assigned the  <value>.   When
                     extended  header  records conflict, the last one given in(1,8)
                     the header shall take precedence.

              5.     If -o keyword=value is used, the affected attribute shall
                     be assigned the value.

              6.     If  there  is a typeflag g global extended header record,
                     the affected attribute shall  be  assigned  the  <value>.
                     When  global  extended  header records conflict, the last
                     one given in(1,8) the global header shall take precedence.

              7.     Otherwise, the attribute shall  be  determined  from  the
                     ustar header block.


   pax Extended Header File Times
       The  pax  utility shall write(1,2) an mtime record for each file(1,n) in(1,8) write(1,2) or
       copy modes if(3,n)  the  file(1,n)'s  modification  time(1,2,n)  cannot  be  represented
       exactly  in(1,8)  the  ustar header logical record described in(1,8) ustar Inter-
       change Format.  This can occur if(3,n) the time(1,2,n) is out of ustar range, or if(3,n)
       the  file(1,n)  system of the underlying implementation supports non-integer
       time(1,2,n) granularities and the time(1,2,n) is not an integer. All  of  these  time(1,2,n)
       records  shall  be formatted as a decimal representation of the time(1,2,n) in(1,8)
       seconds since the Epoch. If a period ('.') decimal point  character  is
       present, the digits to the right of the point shall represent the units(1,7)
       of a subsecond timing granularity, where the first digit is tenths of a
       second  and  each subsequent digit is a tenth of the previous digit. In
       read(2,n,1 builtins) or copy mode, the pax utility shall truncate(2,7) the time(1,2,n) of a file(1,n) to
       the greatest value that is not greater than the input header file(1,n) time.
       In write(1,2) or copy mode, the pax utility shall output a time(1,2,n)  exactly  if(3,n)
       it  can be represented exactly as a decimal number, and otherwise shall
       generate only enough digits so that the same time(1,2,n) shall be recovered if(3,n)
       the  file(1,n) is extracted on a system whose underlying implementation sup-
       ports the same time(1,2,n) granularity.


   ustar Interchange Format
       A ustar archive tape or file(1,n) shall contain a series of logical records.
       Each  logical record shall be a fixed-size logical record of 512 octets
       (see below). Although this format may be thought of as being stored  on
       9-track  industry-standard  12.7 mm (0.5 in(1,8)) magnetic tape, other types
       of transportable media are not excluded. Each file(1,n)  archived  shall  be
       represented  by  a  header logical record that describes the file(1,n), fol-
       lowed by zero or more logical records that give  the  contents  of  the
       file. At the end of the archive file(1,n) there shall be two 512-octet logi-
       cal records filled with binary zeros, interpreted as an  end-of-archive
       indicator.

       The  logical  records  may  be  grouped for physical I/O operations, as
       described under the -b blocksize and -x ustar options.  Each  group  of
       logical  records  may  be written with a single operation equivalent to
       the write(1,2)(2) function. On magnetic tape, the result of this write(1,2) shall
       be  a  single tape physical block. The last physical block shall always
       be the full size, so logical records after the two zero logical records
       may contain undefined data.

       The header logical record shall be structured as shown in(1,8) the following
       table. All lengths and offsets are in(1,8) decimal.


                              Table: ustar Header Block

                  +-----------+--------------+--------------------+
                  |Field Name | Octet Offset | Length (in(1,8) Octets) |
                  +-----------+--------------+--------------------+
                  |name       |       0      |        100         |
                  |mode       |     100      |          8         |
                  |uid        |     108      |          8         |
                  |gid        |     116      |          8         |
                  |size       |     124      |         12         |
                  |mtime      |     136      |         12         |
                  |chksum     |     148      |          8         |
                  |typeflag   |     156      |          1         |
                  |linkname   |     157      |        100         |
                  |magic(4,5)      |     257      |          6         |
                  |version(1,3,5)    |     263      |          2         |
                  |uname(1,2)      |     265      |         32         |
                  |gname      |     297      |         32         |
                  |devmajor   |     329      |          8         |
                  |devminor   |     337      |          8         |
                  |prefix     |     345      |        155         |
                  +-----------+--------------+--------------------+
       All characters in(1,8) the header logical record shall be represented in(1,8) the
       coded  character  set(7,n,1 builtins)  of  the  ISO/IEC  646:1991 standard. For maximum
       portability between implementations,  names  should  be  selected  from
       characters represented by the portable filename character set(7,n,1 builtins) as octets
       with the most significant bit zero. If an implementation  supports  the
       use  of characters outside of slash and the portable filename character
       set(7,n,1 builtins) in(1,8) names for files, users(1,5), and groups, one or more  implementation-
       defined encodings of these characters shall be provided for interchange
       purposes.

       However, the pax utility shall never create filenames on the local sys-
       tem  that  cannot  be accessed via the procedures described in(1,8) IEEE Std
       1003.1-2001. If a filename is found on the medium that would create  an
       invalid  filename,  it  is implementation-defined whether the data from
       the file(1,n) is stored on the file(1,n) hierarchy and  under  what  name  it  is
       stored.  The pax utility may choose to ignore these files as long as it
       produces an error(8,n) indicating that the file(1,n) is being ignored.

       Each field within the header logical record  is  contiguous;  that  is,
       there is no padding used. Each character on the archive medium shall be
       stored contiguously.

       The fields magic(4,5), uname(1,2), and gname are character  strings  each  termi-
       nated  by  a  NUL  character. The fields name, linkname, and prefix are
       NUL-terminated character strings except  when  all  characters  in(1,8)  the
       array contain non-NUL characters including the last character. The ver-
       sion field is two octets containing the  characters  "00"  (zero-zero).
       The  typeflag contains a single character. All other fields are leading
       zero-filled octal numbers using digits from the ISO/IEC 646:1991  stan-
       dard  IRV.  Each  numeric field is terminated by one or more <space> or
       NUL characters.

       The name and the prefix fields shall produce the pathname of the  file.
       A  new  pathname shall be formed, if(3,n) prefix is not an empty string(3,n) (its
       first character is not NUL), by concatenating prefix (up to  the  first
       NUL  character),  a  slash character, and name; otherwise, name is used
       alone. In either case, name is terminated at the first  NUL  character.
       If  prefix  begins  with  a NUL character, it shall be ignored. In this
       manner, pathnames of at most 256 characters  can  be  supported.  If  a
       pathname  does not fit in(1,8) the space provided, pax shall notify the user
       of the error(8,n), and shall not store any part of the file-header or  data-
       on the medium.

       The  linkname  field, described below, shall not use the prefix to pro-
       duce a pathname. As such, a linkname is limited to 100  characters.  If
       the  name does not fit in(1,8) the space provided, pax shall notify the user
       of the error(8,n), and shall not attempt to store the link(1,2) on the medium.

       The mode field provides 12 bits encoded in(1,8) the ISO/IEC  646:1991  stan-
       dard  octal  digit representation. The encoded bits shall represent the
       following values:


                               Table: ustar mode Field

     +------+-----------------+-------------------------------------------------+
     | Bit  |    IEEE Std     |                   Description                   |
     |Value | 1003.1-2001 Bit |                                                 |
     +------+-----------------+-------------------------------------------------+
     |04000 | S_ISUID         | Set UID on execution.                           |
     |02000 | S_ISGID         | Set GID on execution.                           |
     |01000 | <reserved>      | Reserved for future standardization.            |
     |00400 | S_IRUSR         | Read permission for file(1,n) owner class.           |
     |00200 | S_IWUSR         | Write permission for file(1,n) owner class.          |
     |00100 | S_IXUSR         | Execute/search permission for file(1,n) owner class. |
     |00040 | S_IRGRP         | Read permission for file(1,n) group class.           |
     |00020 | S_IWGRP         | Write permission for file(1,n) group class.          |
     |00010 | S_IXGRP         | Execute/search permission for file(1,n) group class. |
     |00004 | S_IROTH         | Read permission for file(1,n) other class.           |
     |00002 | S_IWOTH         | Write permission for file(1,n) other class.          |
     |00001 | S_IXOTH         | Execute/search permission for file(1,n) other class. |
     +------+-----------------+-------------------------------------------------+
       When appropriate privilege is required to set(7,n,1 builtins) one of these  mode  bits,
       and  the  user  restoring  the files from the archive does not have the
       appropriate privilege, the mode bits for which the user does  not  have
       appropriate  privilege  shall  be ignored. Some of the mode bits in(1,8) the
       archive format are not mentioned elsewhere in(1,8) this volume of  IEEE  Std
       1003.1-2001.  If  the  implementation does not support those bits, they
       may be ignored.

       The uid and gid fields are the user and group ID of the owner and group
       of the file(1,n), respectively.

       The size field is the size of the file(1,n) in(1,8) octets. If the typeflag field
       is set(7,n,1 builtins) to specify a file(1,n) to be of type 1 (a  link(1,2))  or  2  (a  symbolic
       link(1,2)), the size field shall be specified as zero. If the typeflag field
       is set(7,n,1 builtins) to specify a file(1,n) of type 5 (directory), the size field shall be
       interpreted  as  described under the definition of that record type. No
       data logical records are stored for types 1, 2, or 5. If  the  typeflag
       field  is set(7,n,1 builtins) to 3 (character special file(1,n)), 4 (block special file(1,n)), or
       6 (FIFO), the meaning of the size field is unspecified by  this  volume
       of IEEE Std 1003.1-2001, and no data logical records shall be stored on
       the medium.  Additionally, for type 6, the size field shall be  ignored
       when reading. If the typeflag field is set(7,n,1 builtins) to any other value, the num-
       ber  of  logical  records  written  following  the  header   shall   be
       (size+511)/512, ignoring any fraction in(1,8) the result of the division.

       The  mtime field shall be the modification time(1,2,n) of the file(1,n) at the time(1,2,n)
       it was archived. It is the ISO/IEC 646:1991 standard representation  of
       the  octal  value  of  the  modification time(1,2,n) obtained from the stat(1,2)(2)
       function.

       The chksum field shall be the ISO/IEC 646:1991 standard IRV representa-
       tion  of  the octal value of the simple sum of all octets in(1,8) the header
       logical record. Each octet  in(1,8)  the  header  shall  be  treated  as  an
       unsigned  value.  These  values  shall be added to an unsigned integer,
       initialized to zero, the precision of which is not less(1,3) than  17  bits.
       When  calculating  the  checksum,  the chksum field is treated as if(3,n) it
       were all spaces.

       The typeflag field specifies the type of file(1,n) archived. If a particular
       implementation  does  not recognize the type, or the user does not have
       appropriate privilege to create that type, the file(1,n) shall be  extracted
       as  if(3,n)  it  were  a  regular file(1,n) if(3,n) the file(1,n) type is defined to have a
       meaning for the size field that could cause data logical records to  be
       written on the medium (see the previous description for size).  If con-
       version(1,3,5) to a regular file(1,n) occurs, the  pax  utility  shall  produce  an
       error(8,n)  indicating  that  the conversion took place. All of the typeflag
       fields shall be coded in(1,8) the ISO/IEC 646:1991 standard IRV:

       0      Represents a regular file. For backwards-compatibility, a  type-
              flag value of binary zero ('\0') should be recognized as meaning
              a regular file(1,n) when extracting files from the archive.  Archives
              written with this version(1,3,5) of the archive file(1,n) format create reg-
              ular files with a typefla value of the ISO/IEC 646:1991 standard
              IRV '0'.

       1      Represents  a  file(1,n)  linked to another file(1,n), of any type, previ-
              ously archived. Such files are identified  by  having  the  same
              device and file(1,n) serial numbers, and pathnames that refer to dif-
              ferent directory entries. All such files shall  be  archived  as
              linked  files.  The  linked-to name is specified in(1,8) the linkname
              field with a NUL-character terminator if(3,n) it  is  less(1,3)  than  100
              octets in(1,8) length.

       2      Represents  a  symbolic  link. The contents of the symbolic link(1,2)
              shall be stored in(1,8) the linkname field.

       3,4    Represent  character  special  files  and  block  special  files
              respectively.  In  this  case  the  devmajor and devminor fields
              shall contain information defining the  device,  the  format  of
              which  is  unspecified  by  this volume of IEEE Std 1003.1-2001.
              Implementations may map the device specifications to  their  own
              local specification or may ignore the entry.

       5      Specifies  a  directory  or  subdirectory. On systems where disk
              allocation is performed on a directory  basis,  the  size  field
              shall contain the maximum number of octets (which may be rounded
              to the nearest disk block allocation unit)  that  the  directory
              may  hold. A size field of zero indicates no such limiting. Sys-
              tems that do not support limiting in(1,8) this manner  should  ignore
              the size field.

       6      Specifies a FIFO special file. Note that the archiving of a FIFO
              file(1,n) archives the existence of this file(1,n) and not its contents.

       7      Reserved to represent a file(1,n)  to  which  an  implementation  has
              associated   some  high-performance  attribute.  Implementations
              without such extensions should treat this file(1,n) as a regular file(1,n)
              (type 0).

       A-Z    The  letters  'A'  to  'Z',  inclusive,  are reserved for custom
              implementations. All other values are reserved for  future  ver-
              sions of IEEE Std 1003.1-2001.

       It  is  unspecified whether files with pathnames that refer to the same
       directory entry are archived as linked files or as separate  files.  If
       they  are  archived  as  linked  files,  this  means that attempting to
       extract both pathnames from the resulting archive will always cause  an
       error(8,n)  (unless  the  -u option is used) because the link(1,2) cannot be cre-
       ated.

       It is unspecified whether files with the same device  and  file(1,n)  serial
       numbers  being  appended  to  an archive are treated as linked files to
       members that were in(1,8) the archive before the append.

       Attempts to archive a socket(2,7,n) using ustar interchange format shall  pro-
       duce  a diagnostic message. Handling of other file(1,n) types is implementa-
       tion-defined.

       The magic(4,5) field is the specification that this archive  was  output  in(1,8)
       this  archive format. If this field contains ustar (the five characters
       from the ISO/IEC 646:1991 standard IRV  shown  followed  by  NUL),  the
       uname(1,2)  and gname fields shall contain the ISO/IEC 646:1991 standard IRV
       representation of the owner and group of the file(1,n), respectively  (trun-
       cated  to  fit,  if(3,n)  necessary).  When the file(1,n) is restored by a privi-
       leged, protection-preserving version(1,3,5) of the utility, the user and group
       databases  shall  be  scanned  for  these names. If found, the user and
       group IDs contained within these files shall be used  rather  than  the
       values contained within the uid and gid fields.


   cpio Interchange Format
       The  octet-oriented  cpio  archive format shall be a series of entries,
       each comprising a header that describes the file(1,n), the name of the file(1,n),
       and then the contents of the file.

       An  archive may be recorded as a series of fixed-size blocks of octets.
       This blocking shall be used only to make physical I/O  more  efficient.
       The last group of blocks shall always be at the full size.

       For the octet-oriented cpio archive format, the individual entry infor-
       mation shall be in(1,8) the order indicated and described by  the  following
       table; see also the <cpio.h> header.


                      Table: Octet-Oriented cpio Archive Entry

            +---------------------+--------------------+-----------------+
            | Header Field Name   | Length (in(1,8) Octets) | Interpreted as  |
            +---------------------+--------------------+-----------------+
            |c_magic              | 6                  | Octal number    |
            |c_dev                | 6                  | Octal number    |
            |c_ino                | 6                  | Octal number    |
            |c_mode               | 6                  | Octal number    |
            |c_uid                | 6                  | Octal number    |
            |c_gid                | 6                  | Octal number    |
            |c_nlink              | 6                  | Octal number    |
            |c_rdev               | 6                  | Octal number    |
            |c_mtime              | 11                 | Octal number    |
            |c_namesize           | 6                  | Octal number    |
            |c_filesize           | 11                 | Octal number    |
            |                     |                    |                 |
            |Filename Field Name  | Length             | Interpreted as  |
            |c_name               | c_namesize         | Pathname string(3,n) |
            |                     |                    |                 |
            |File Data Field Name | Length             | Interpreted as  |
            |c_filedata           | c_filesize         | Data            |
            +---------------------+--------------------+-----------------+

   cpio Header
       For  each  file(1,n) in(1,8) the archive, a header as defined previously shall be
       written. The information in(1,8) the header fields is written as streams  of
       the  ISO/IEC 646:1991 standard characters interpreted as octal numbers.
       The octal numbers shall be extended to the necessary length by  append-
       ing  the  ISO/IEC  646:1991 standard IRV zeros at the most-significant-
       digit end of the number; the result is written to the  most-significant
       digit of the stream of octets first. The fields shall be interpreted as
       follows:


       c_magic
              Identify the archive as being a transportable  archive  by  con-
              taining the identifying value "070707".

       c_dev, c_ino
              Contains  values  that uniquely identify the file(1,n) within the ar-
              chive (that is, no files contain the  same  pair  of  c_dev  and
              c_ino values unless they are links to the same file(1,n)). The values
              shall be determined in(1,8) an unspecified manner.

       c_mode Contains the file(1,n) type and access(2,5) permissions as defined in(1,8)  the
              following table.


                            Table: Values for cpio c_mode Field

                 +----------------------+---------+------------------------+
                 |File Permissions Name |  Value  |       Indicates        |
                 +----------------------+---------+------------------------+
                 |C_IRUSR               | 000400  | Read by owner          |
                 |C_IWUSR               | 000200  | Write by owner         |
                 |C_IXUSR               | 000100  | Execute by owner       |
                 |C_IRGRP               | 000040  | Read by group          |
                 |C_IWGRP               | 000020  | Write by group         |
                 |C_IXGRP               | 000010  | Execute by group       |
                 |C_IROTH               | 000004  | Read by others         |
                 |C_IWOTH               | 000002  | Write by others        |
                 |C_IXOTH               | 000001  | Execute by others      |
                 |C_ISUID               | 004000  | Set uid                |
                 |C_ISGID               | 002000  | Set gid                |
                 |C_ISVTX               | 001000  | Reserved               |
                 +----------------------+---------+------------------------+
                 |File Type Name        | Value   | Indicates              |
                 +----------------------+---------+------------------------+
                 |C_ISDIR               | 0040000 | Directory              |
                 |C_ISFIFO              | 0010000 | FIFO                   |
                 |C_ISREG               | 0100000 | Regular file(1,n)           |
                 |C_ISLNK               | 0120000 | Symbolic link(1,2)          |
                 |C_ISBLK               | 0060000 | Block special file(1,n)     |
                 |C_ISCHR               | 0020000 | Character special file(1,n) |
                 |C_ISSOCK              | 0140000 | Socket                 |
                 |C_ISCTG               | 0110000 | Reserved               |
                 +----------------------+---------+------------------------+
              Directories,  FIFOs,  symbolic links, and regular files shall be
              supported on a system conforming to  this  volume  of  IEEE  Std
              1003.1-2001;  additional  values defined previously are reserved
              for compatibility with existing systems.  Additional file(1,n)  types
              may  be  supported; however, such files should not be written to
              archives intended to be transported to other systems.

       c_uid  Contains the user ID of the owner.

       c_gid  Contains the group ID of the group.

       c_nlink
              Contains a number greater than or equal to the number  of  links
              in(1,8) the archive referencing the file. If the -a option is used to
              append to a cpio archive, then the pax utility need not  account
              for the files in(1,8) the existing part of the archive when calculat-
              ing the c_nlink values for the appended part of the archive, and
              need  not  alter  the c_nlink values in(1,8) the existing part of the
              archive if(3,n) additional files with the same c_dev and c_ino values
              are appended to the archive.

       c_rdev Contains  implementation-defined  information  for  character or
              block special files.

       c_mtime
              Contains the latest time(1,2,n) of modification of the file(1,n) at the time(1,2,n)
              the archive was created.

       c_namesize
              Contains  the  length of the pathname, including the terminating
              NUL character.

       c_filesize
              Contains the length of the file(1,n) in(1,8) octets.  This  shall  be  the
              length of the data section following the header structure.


   cpio Filename
       The  c_name field shall contain the pathname of the file. The length of
       this field in(1,8) octets is the value of c_namesize.

       If a filename is found on the medium that would create an invalid path-
       name,  it  is  implementation-defined whether the data from the file(1,n) is
       stored on the file(1,n) hierarchy and under what name it is stored.

       All characters shall be represented in(1,8) the  ISO/IEC  646:1991  standard
       IRV.  For  maximum portability between implementations, names should be
       selected from characters represented by the portable filename character
       set(7,n,1 builtins)  as octets with the most significant bit zero. If an implementation
       supports the use of characters outside the portable filename  character
       set(7,n,1 builtins)  in(1,8) names for files, users(1,5), and groups, one or more implementation-
       defined encodings of these characters shall be provided for interchange
       purposes.  However, the pax utility shall never create filenames on the
       local system that cannot be accessed via the procedures described  pre-
       viously  in(1,8) this volume of IEEE Std 1003.1-2001. If a filename is found
       on the medium that would create an invalid filename, it is  implementa-
       tion-defined whether the data from the file(1,n) is stored on the local file(1,n)
       system and under what name it is stored. The pax utility may choose  to
       ignore  these files as long as it produces an error(8,n) indicating that the
       file(1,n) is being ignored.


       Following c_name, there shall be c_filesize octets of data.   Interpre-
       tation  of  such  data  occurs  in(1,8)  a  manner dependent on the file. If
       c_filesize is zero, no data shall be contained in(1,8) c_filedata.

       When restoring from an archive:

             If the user does not have the appropriate privilege to create  a
              file(1,n) of the specified type, pax shall ignore the entry and write(1,2)
              an error(8,n) message to standard error.

             Only regular files have data to be restored. Presuming a regular
              file(1,n)  meets  any selection criteria that might be imposed on the
              format-reading utility by the user, such data shall be restored.

             If  a user does not have appropriate privilege to set(7,n,1 builtins) a particu-
              lar mode flag, the flag shall be ignored. Some of the mode flags
              in(1,8) the archive format are not mentioned elsewhere in(1,8) this volume
              of IEEE Std 1003.1-2001. If the implementation does not  support
              those flags, they may be ignored.


   cpio Special Entries
       FIFO special files, directories, and the trailer shall be recorded with
       c_filesize equal to  zero.  For  other  special  files,  c_filesize  is
       unspecified  by this volume of IEEE Std 1003.1-2001. The header for the
       next file(1,n) entry in(1,8) the archive shall be written directly after the last
       octet  of  the  file(1,n) entry preceding it. A header denoting the filename
       TRAILER!!!  shall indicate the end of  the  archive;  the  contents  of
       octets  in(1,8)  the  last  block of the archive following such a header are
       undefined.


EXIT STATUS
       The following exit(3,n,1 builtins) values shall be returned:

        0     All files were processed successfully.

       >0     An error(8,n) occurred.


CONSEQUENCES OF ERRORS
       If pax cannot create a file(1,n) or a link(1,2) when reading an archive or cannot
       find  a  file(1,n)  when writing an archive, or cannot preserve the user ID,
       group ID, or file(1,n) mode when the -p option is  specified,  a  diagnostic
       message  shall  be written to standard error(8,n) and a non-zero exit(3,n,1 builtins) status
       shall be returned, but processing shall continue. In the case where pax
       cannot  create  a  link(1,2)  to a file(1,n), pax shall not, by default, create a
       second copy of the file.

       If the extraction of a file(1,n) from an archive is  prematurely  terminated
       by a signal(2,7) or error(8,n), pax may have only partially extracted the file(1,n) or
       (if(3,n) the -n option was not specified) may have extracted a file(1,n)  of  the
       same  name as that specified by the user, but which is not the file(1,n) the
       user wanted. Additionally, the file(1,n) modes of extracted directories  may
       have  additional  bits  from  the S_IRWXU mask set(7,n,1 builtins) as well as incorrect
       modification and access(2,5) times.


______________________________________________________________________________
The following sections are informative.


APPLICATION USAGE
       Caution  is advised when using the -a option to append to a cpio format
       archive. If any of the files being appended happen to be given the same
       c_dev  and  c_ino values as a file(1,n) in(1,8) the existing part of the archive,
       then they may be treated as links to that file(1,n) on extraction. Thus,  it
       is  risky to use -a with cpio format except when it is done on the same
       system that the original archive was created on, and with the same  pax
       utility,  and  in(1,8)  the  knowledge that there has been little or no file(1,n)
       system activity since the original archive was created that could  lead
       to  any of the files appended being given the same c_dev and c_ino val-
       ues as an unrelated file(1,n) in(1,8) the existing part  of  the  archive.  Also,
       when (intentionally) appending additional links to a file(1,n) in(1,8) the exist-
       ing part of the archive, the c_nlink values in(1,8) the modified archive can
       be  smaller  than the number of links to the file(1,n) in(1,8) the archive, which
       may mean that the links are not preserved on extraction.

       The -p  (privileges)  option  was  invented  to  reconcile  differences
       between historical tar and cpio implementations. In particular, the two
       utilities use -m in(1,8) diametrically opposed ways. The -p option also pro-
       vides  a  consistent  means  of extending the ways in(1,8) which future file(1,n)
       attributes can be addressed, such as for enhanced security  systems  or
       high-performance  files. Although it may seem complex, there are really
       two modes that are most commonly used:

       -p e   ``Preserve everything". This would be  used  by  the  historical
              superuser,  someone with all the appropriate privileges, to pre-
              serve all aspects of the files as they are recorded in(1,8)  the  ar-
              chive.  The  e flag is the sum of o and p, and other implementa-
              tion-defined attributes.

       -p p   ``Preserve" the file(1,n) mode bits. This would be used by  the  user
              with  regular  privileges  who wished to preserve aspects of the
              file(1,n) other than the ownership. The file(1,n) times are  preserved  by
              default,  but  two  other flags are offered to disable these and
              use the time(1,2,n) of extraction.

       The one pathname per line format of standard input precludes  pathnames
       containing  <newline>s.  Although  such  pathnames violate the portable
       filename guidelines, they may exist  and  their  presence  may  inhibit
       usage  of pax within shell scripts. This problem is inherited from his-
       torical archive programs. The problem can be avoided by  listing  file-
       name arguments on the command line instead of on standard input.

       It  is  almost certain that appropriate privileges are required for pax
       to accomplish parts of this volume of IEEE Std  1003.1-2001.   Specifi-
       cally,  creating  files  of  type  block  special or character special,
       restoring file(1,n) access(2,5) times unless the files are owned by the user (the
       -t  option),  or preserving file(1,n) owner, group, and mode (the -p option)
       all probably require appropriate privileges.

       In read(2,n,1 builtins) mode, implementations are permitted to overwrite files when the
       archive  has multiple members with the same name. This may fail if(3,n) per-
       missions on the first version(1,3,5) of the file(1,n) do not permit it to be  over-
       written.

       The  cpio  and  ustar  formats  can only support files up to 8589934592
       bytes (8 * 2^30) in(1,8) size.


EXAMPLES
       The following command:

            pax -w -f /dev/rmt/1m .

       copies the contents of the current directory to tape  drive  1,  medium
       density (assuming historical System V device naming procedures-the his-
       torical BSD device name would be /dev/rmt9).

       The following commands:

            mkdir(1,2) newdirpax -rw olddir newdir

       copy the olddir directory hierarchy to newdir.

            pax -r -s ',^//*usr//*,,' -f a.pax

       reads the archive a.pax, with all files rooted in(1,8) /usr in(1,8)  the  archive
       extracted relative to the current directory.

       Using the option:

            -o listopt="%M %(atime)T %(size)D %(name)s"

       overrides the default output description in(1,8) Standard Output and instead
       writes:

            -rw-rw--- Jan 12 15:53 1492 /usr/foo/bar

       Using the options:

            -o listopt='%L%(size)D26.7' .br
            -o listopt='(name)s26(atime)T26T'

       overrides the default output description in(1,8) Standard Output and instead
       writes:

       /usr/foo/bar -> /tmp   1492
       /usr/fo
       Jan 12 1991
       Jan 31 15:53


RATIONALE
       The  pax  utility  was new for the ISO POSIX-2:1993 standard. It repre-
       sents a peaceful compromise between advocates of the historical tar and
       cpio utilities.

       A  fundamental  difference between cpio and tar was in(1,8) the way directo-
       ries were treated. The cpio utility did not treat  directories  differ-
       ently  from  other  files,  and  to select(2,7,2 select_tut) a directory and its contents
       required that each file(1,n) in(1,8) the hierarchy be explicitly  specified.  For
       tar, a directory matched every file(1,n) in(1,8) the file(1,n) hierarchy it rooted.

       The  pax  utility  offers  both interfaces; by default, directories map
       into the file(1,n) hierarchy they root. The -d option causes pax to skip any
       file(1,n)  not  explicitly  referenced, as cpio historically did.  The tar -
       style behavior was chosen as the default because it was  believed  that
       this  was  the  more  common usage and because tar is the more commonly
       available interface, as it was historically provided on both  System  V
       and BSD implementations.

       The  data  interchange  format specification in(1,8) this volume of IEEE Std
       1003.1-2001 requires that processes with "appropriate privileges" shall
       always restore the ownership and permissions of extracted files exactly
       as archived. If viewed from the historic equivalence between  superuser
       and "appropriate privileges", there are two problems with this require-
       ment. First, users(1,5) running as superusers may unknowingly set(7,n,1 builtins)  dangerous
       permissions  on  extracted files. Second, it is needlessly limiting, in(1,8)
       that superusers cannot extract files and own them as  superuser  unless
       the  archive  was  created  by  the superuser. (It should be noted that
       restoration  of  ownerships  and  permissions  for  the  superuser,  by
       default,  is historical practice in(1,8) cpio, but not in(1,8) tar.)  In order to
       avoid these two problems,  the  pax  specification  has  an  additional
       "privilege"  mechanism,  the  -p option. Only a pax invocation with the
       privileges needed, and which has the -p option set(7,n,1 builtins) using the e specifi-
       cation  character, has the "appropriate privilege" to restore full own-
       ership and permission information.

       Note also that this volume of IEEE Std 1003.1-2001  requires  that  the
       file(1,n)  ownership  and access(2,5) permissions shall be set(7,n,1 builtins), on extraction, in(1,8)
       the same fashion as the creat(2) function when provided with  the  mode
       stored  in(1,8)  the  archive. This means that the file(1,n) creation mask of the
       user is applied to the file(1,n) permissions.

       Users should note that directories may be created by pax while extract-
       ing  files  with permissions that are different from those that existed
       at the time(1,2,n) the archive was created. When extracting sensitive informa-
       tion  into  a  directory  hierarchy  that  no  longer exists, users(1,5) are
       encouraged to set(7,n,1 builtins) their file(1,n) creation  mask  appropriately  to  protect
       these files during extraction.

       The  table  of contents output is written to standard output to facili-
       tate pipeline processing.

       An early proposal had hard links displaying for  all  pathnames.   This
       was  removed  because it complicates the output of the case where -v is
       not specified and does not match historical cpio usage.  The  hard-link
       information is available in(1,8) the -v display.

       The  description  of  the -l option allows implementations to make hard
       links to symbolic links. IEEE Std 1003.1-2001 does not specify any  way
       to create a hard link(1,2) to a symbolic link(1,2), but many implementations pro-
       vide this capability as an extension. If there are hard links  to  sym-
       bolic  links when an archive is created, the implementation is required
       to archive the hard link(1,2) in(1,8) the archive (unless -H or -L is specified).
       When  in(1,8)  read(2,n,1 builtins)  mode  and in(1,8) copy mode, implementations supporting hard
       links to symbolic links should use them when appropriate.

       The archive formats inherited from the POSIX.1-1990 standard have  cer-
       tain  restrictions  that have been brought along from historical usage.
       For example, there are restrictions on the length of  pathnames  stored
       in(1,8)  the archive. When pax is used in(1,8) copy (-rw) mode (copying directory
       hierarchies), the ability to use extensions  from  the  -x  pax  format
       overcomes these restrictions.

       The default blocksize value of 5120 bytes for cpio was selected because
       it is one of the standard block-size values for cpio, set(7,n,1 builtins) when  the  -B
       option  is  specified.  (The other default block-size value for cpio is
       512 bytes, and this was considered to be too small.) The default  block
       value  of 10240 bytes for tar was selected because that is the standard
       block-size value for BSD tar.  The maximum block size  of  32256  bytes
       (2^15-512  bytes) is the largest multiple of 512 bytes that fits into a
       signed 16-bit tape controller transfer register. There are known  limi-
       tations  in(1,8)  some  historical  systems that would prevent larger blocks
       from being accepted. Historical values were chosen to improve  compati-
       bility  with  historical  scripts  using  dd(1) or similar utilities to
       manipulate archives. Also, default block sizes for any file(1,n) type  other
       than  character  special file(1,n) has been deleted from this volume of IEEE
       Std 1003.1-2001 as unimportant and not likely to affect  the  structure
       of the resulting archive.

       Implementations  are  permitted to modify the block-size value based on
       the archive format or the device to which the archive is being written.
       This  is to provide implementations with the opportunity to take advan-
       tage of special types of devices, and it should not be used  without  a
       great  deal  of  consideration as it almost certainly decreases archive
       portability.

       The intended use of the -n option was to permit extraction  of  one  or
       more files from the archive without processing the entire archive. This
       was viewed by the standard developers as offering  significant  perfor-
       mance  advantages  over  historical  implementations.  The -n option in(1,8)
       early proposals had three effects; the first was to cause special char-
       acters in(1,8) patterns to not be treated specially. The second was to cause
       only the first file(1,n) that matched a pattern to be extracted.  The  third
       was  to  cause pax to write(1,2) a diagnostic message to standard error(8,n) when
       no file(1,n) was found matching a specified pattern. Only the second  behav-
       ior  is  retained by this volume of IEEE Std 1003.1-2001, for many rea-
       sons. First, it is in(1,8) general not acceptable for  a  single  option  to
       have  multiple  effects.  Second,  the ability to make pattern matching
       characters act as normal characters is useful for parts  of  pax  other
       than file(1,n) extraction. Third, a finer degree of control over the special
       characters is useful because users(1,5) may wish to normalize only a  single
       special  character  in(1,8)  a single filename. Fourth, given a more general
       escape mechanism, the previous behavior of the -n option can be  easily
       obtained  using the -s option or a sed script. Finally, writing a diag-
       nostic message when a pattern specified by the user is unmatched by any
       file(1,n) is useful behavior in(1,8) all cases.

       In this version(1,3,5), the -n was removed from the copy mode synopsis of pax;
       it is inapplicable because there are no pattern operands  specified  in(1,8)
       this mode.

       There  is  another  method  than  pax  for copying subtrees in(1,8) IEEE Std
       1003.1-2001 described as part of the cp(1) utility.  Both  methods  are
       historical  practice:  cp(1)  provides a simpler, more intuitive inter-
       face, while pax offers a finer granularity of  control.  Each  provides
       additional functionality to the other; in(1,8) particular, pax maintains the
       hard-link structure of the hierarchy while cp(1) does not.  It  is  the
       intention of the standard developers that the results be similar (using
       appropriate option combinations in(1,8) both utilities). The results are not
       required  to  be  identical; there seemed insufficient gain to applica-
       tions to balance the difficulty of implementations having to  guarantee
       that the results would be exactly identical.

       A  single  archive  may  span  more than one file. It is suggested that
       implementations provide informative messages to the  user  on  standard
       error(8,n) whenever the archive file(1,n) is changed.

       The -d option (do not create intermediate directories not listed in(1,8) the
       archive) found in(1,8) early proposals was originally provided as a  comple-
       ment to the historic -d option of cpio.  It has been deleted.

       The -s option in(1,8) early proposals specified a subset of the substitution
       command from the ed utility. As there was no reason for only  a  subset
       to  be  supported,  the -s option is now compatible with the current ed
       specification. Since the delimiter can be any non-null  character,  the
       following usage with single spaces is valid:

            pax -s " foo bar " ...

       The  -t  description  is  worded  so as to note that this may cause the
       access(2,5) time(1,2,n) update(7,n) caused by some other activity  (which  occurs  while
       the file(1,n) is being read(2,n,1 builtins)) to be overwritten.

       The  default  behavior of pax with regard to file(1,n) modification times is
       the same as historical implementations of tar.  It is not the  histori-
       cal behavior of cpio.

       Because  the  -i  option uses /dev/tty(1,4), utilities without a controlling
       terminal are not able to use this option.

       The -y option, found in(1,8) early proposals, has  been  deleted  because  a
       line  containing a single period for the -i option has equivalent func-
       tionality. The special lines for the -i option (a single period and the
       empty line) are historical practice in(1,8) cpio.

       In early drafts, a -e charmap option was included to increase portabil-
       ity of files between systems using different coded character sets. This
       option  was omitted because it was apparent that consensus could not be
       formed for it. In this version(1,3,5), the use of UTF-8 should be an  adequate
       substitute.

       The  -k  option  was  added to address international concerns about the
       dangers involved in(1,8) the character set(7,n,1 builtins) transformations  of  -e  (if(3,n)  the
       target  character  set(7,n,1 builtins)  were  different  from the source, the filenames
       might be transformed into names matching existing files) and  also  was
       made  more  general  to  protect files transferred between file(1,n) systems
       with different {NAME_MAX} values (truncating a filename  on  a  smaller
       system  might  also inadvertently overwrite existing files). As stated,
       it prevents any overwriting, even if(3,n) the target file(1,n) is older than  the
       source.  This  version(1,3,5)  adds  more granularity of options to solve this
       problem by introducing the -o invalid=option  -specifically  the  UTF-8
       action. (Note that an existing file(1,n) that is named(5,8) with a UTF-8 encoding(3,n)
       is still subject to overwriting in(1,8) this case. The -k option closes that
       loophole.)

       Some  of the file(1,n) characteristics referenced in(1,8) this volume of IEEE Std
       1003.1-2001 might not be supported by some archive formats.  For  exam-
       ple, neither the tar nor cpio formats contain the file(1,n) access(2,5) time. For
       this reason, the e specification character has been provided,  intended
       to  cause  all  file(1,n)  characteristics  specified  in(1,8)  the archive to be
       retained.

       It is required that  extracted  directories,  by  default,  have  their
       access(2,5)  and modification times and permissions set(7,n,1 builtins) to the values speci-
       fied in(1,8) the archive. This has obvious problems in(1,8) that the  directories
       are  almost certainly modified after being extracted and that directory
       permissions may not permit file(1,n) creation. One possible solution  is  to
       create  directories with the mode specified in(1,8) the archive, as modified
       by the umask of the user, with sufficient  permissions  to  allow  file(1,n)
       creation. After all files have been extracted, pax would then reset(1,7,1 tput) the
       access(2,5) and modification times and permissions as necessary.

       The list-mode formatting  description  borrows  heavily  from  the  one
       defined  by  the printf(1,3,1 builtins)(1) utility. However, since there is no separate
       operand list to get conversion arguments, the format  was  extended  to
       allow  specifying  the  name  of the conversion argument as part of the
       conversion specification.

       The T conversion specifier allows time(1,2,n) fields to be displayed in(1,8) any of
       the  date  formats.  Unlike  the ls(1) utility, pax does not adjust the
       format when the date is less(1,3) than six months in(1,8) the  past.  This  makes
       parsing the output more predictable.

       The   D  conversion  specifier  handles  the  ability  to  display  the
       major/minor or file(1,n) size, as with ls(1), by using %-8(size)D.

       The L conversion specifier handles the ls display for symbolic links.

       Conversion specifiers were added to generate existing known types  used
       for ls(1).


   pax Interchange Format
       The  new  POSIX data interchange format was developed primarily to sat-
       isfy international concerns that the ustar and  cpio  formats  did  not
       provide for file(1,n), user, and group names encoded in(1,8) characters outside a
       subset of the ISO/IEC 646:1991 standard. The standard developers  real-
       ized  that this new POSIX data interchange format should be very exten-
       sible because there were other requirements they foresaw  in(1,8)  the  near
       future:

             Support international character encodings and locale(3,5,7) information

             Support security information (ACLs, and so on)

             Support future file(1,n) types, such as realtime or contiguous files

             Include data areas for implementation use

             Support systems with words larger than 32 bits and  timers  with
              subsecond granularity

       The  following  were not goals for this format because these are better
       handled by separate utilities or are inappropriate for a portable  for-
       mat:

             Encryption

             Compression

             Data translation between locales and codesets

             inode storage

       The  format  chosen  to  support the goals is an extension of the ustar
       format. Of the two formats previously available, only the ustar  format
       was selected for extensions because:

             It was easier to extend in(1,8) an upwards-compatible way. It offered
              version(1,3,5) flags and header block type fields with room for  future
              standardization. The cpio format, while possessing a more flexi-
              ble file(1,n) naming  methodology,  could  not  be  extended  without
              breaking  some theoretical implementation or using a dummy file-
              name that could be a legitimate filename.

             Industry experience since  the  original  "tar wars"  fought  in(1,8)
              developing the ISO POSIX-1 standard has clearly been in(1,8) favor of
              the ustar format, which is generally the default  output  format
              selected for pax implementations on new systems.

       The  new  format was designed with one additional goal in(1,8) mind: reason-
       able behavior when an older tar or pax utility happened to read(2,n,1 builtins) an  ar-
       chive.  Since the POSIX.1-1990 standard mandated that a "format-reading
       utility" had to treat unrecognized typeflag values  as  regular  files,
       this  allowed  the  format to include all the extended information in(1,8) a
       pseudo-regular file(1,n) that preceded each real file. An  option  is  given
       that  allows  the  archive creator to set(7,n,1 builtins) up reasonable names for these
       files on the older systems.  Also, the  normative  text  suggests  that
       reasonable file(1,n) access(2,5) values be used for this ustar header block. Mak-
       ing these header files inaccessible for convenient reading and deleting
       would  not be reasonable. File permissions of 600 or 700 are suggested.

       The ustar typeflag field was used to accommodate the  additional  func-
       tionality  of  the  new format rather than magic(4,5) or version(1,3,5) because the
       POSIX.1-1990 standard (and, by reference, the previous version(1,3,5) of pax),
       mandated the behavior of the format-reading utility when it encountered
       an unknown typeflag, but was silent about the other two fields.

       Early proposals of the first revision to IEEE Std 1003.1-2001 contained
       a  proposed  archive  format  that  was based on compatibility with the
       standard for tape files (ISO 1001, similar to the format used  histori-
       cally  on  many  mainframes  and minicomputers). This format was overly
       complex  and  required  considerable  overhead  in(1,8)  volume  and  header
       records. Furthermore, the standard developers felt that it would not be
       acceptable to the community  of  POSIX  developers,  so  it  was  later
       changed  to  be a format more closely related to historical practice on
       POSIX systems.

       The prefix and name split(1,n) of pathnames in(1,8) ustar  was  replaced  by  the
       single path extended header record for simplicity.

       The concept of a global extended header (typeflag g) was controversial.
       If this were applied to an archive being recorded on magnetic  tape,  a
       few  unreadable  blocks at the beginning of the tape could be a serious
       problem; a utility attempting to extract as many files as possible from
       a damaged archive could lose a large percentage of file(1,n) header informa-
       tion in(1,8) this case. However, if(3,n) the archive were on a  reliable  medium,
       such as a CD-ROM, the global extended header offers considerable poten-
       tial size reductions by eliminating redundant  information.  Thus,  the
       text  warns  against  using  the global method for unreliable media and
       provides a method for implanting global  information  in(1,8)  the  extended
       header for each file(1,n), rather than in(1,8) the typeflag g records.

       No  facility  for  data translation or filtering on a per-file basis is
       included because the standard developers could not invent an  interface
       that  would  allow  this  in(1,8)  an efficient manner. If a filter(1,3x,3x curs_util), such as
       encryption or compression, is to be applied to all  the  files,  it  is
       more  efficient  to  apply the filter(1,3x,3x curs_util) to the entire archive as a single
       file. The standard developers considered interfaces that would invoke a
       shell  script  for  each file(1,n) going into or out of the archive, but the
       system overhead in(1,8) this approach was considered to be too high.

       One such approach would be to have filter(1,3x,3x curs_util)= records that give a pathname
       for  an  executable.  When the program is invoked, the file(1,n) and archive
       would be open(2,3,n) for standard input/output and all the header fields would
       be  available  as  environment variables or command-line arguments. The
       standard developers did discuss such schemes,  but  they  were  omitted
       from  IEEE  Std  1003.1-2001  due to concerns about excessive overhead.
       Also, the program itself would need to be in(1,8) the archive if(3,n) it were  to
       be used portably.

       There  is  currently  no  portable  means  of identifying the character
       set(7,n,1 builtins)(s) used for a file(1,n) in(1,8) the file(1,n) system. Therefore, pax has not  been
       given  a mechanism to generate charset records automatically.  The only
       portable means of doing this is for the user to write(1,2) the archive using
       the -o charset=string(3,n) command line option. This assumes that all of the
       files in(1,8) the  archive  use  the  same  encoding.  The  "implementation-
       defined"  text  is included to allow for a system that can identify the
       encodings used for each of its files.

       The table of standards that accompanies the charset record  description
       is  acknowledged to be very limited. Only a limited number of character
       set(7,n,1 builtins) standards is reasonable for maximal interchange. Any character  set(7,n,1 builtins)
       is,  of  course,  possible  by  prior  agreement. It was suggested that
       EBCDIC be listed, but it was omitted because it is  not  defined  by  a
       formal  standard. Formal standards, and then only those with reasonably
       large followings, can be included here, simply as a matter  of  practi-
       cality. The <value>s represent names of officially registered character
       sets in(1,8) the format required by the ISO 2375:1985 standard.

       The normal comma or <blank>-separated list rules are  not  followed  in(1,8)
       the  case  of  keyword  options  to  allow ease of argument parsing for
       getopts.

       Further information on character encodings is in(1,8) pax Archive  Character
       Set Encoding/Decoding.

       The  standard  developers  have  reserved keyword name space for vendor
       extensions. It is suggested that the format to be used is:

           VENDOR.keyword

       where VENDOR is the name of the vendor or organization in(1,8) all uppercase
       letters.  It is further suggested that the keyword following the period
       be named(5,8) differently than any of the standard keywords so that it could
       be  used  for  future  standardization, if(3,n) appropriate, by omitting the
       VENDOR prefix.

       The <length> field in(1,8) the extended header record was included  to  make
       it  simpler  to  step through the records, even if(3,n) a record contains an
       unknown format (to a particular pax) with complex interactions of  spe-
       cial  characters.  It also provides a minor integrity checkpoint within
       the records to aid a program attempting to recover files from a damaged
       archive.

       There  are  no  extended  header  versions of the devmajor and devminor
       fields because the unspecified format ustar header field should be suf-
       ficient.  If  they  are not, vendor-specific extended keywords (such as
       VENDOR.devmajor) should be used.

       Device and i-number labeling of files was not adopted from cpio;  files
       are interchanged strictly on a symbolic name basis, as in(1,8) ustar.

       Just  as  with  the  ustar format descriptions, the new format makes no
       special arrangements for multi-volume archives. Each of the pax archive
       types  is  assumed  to be inside a single POSIX file(1,n) and splitting that
       file(1,n) over multiple volumes (diskettes, tape  cartridges,  and  so  on),
       processing  their  labels, and mounting each in(1,8) the proper sequence are
       considered to  be  implementation  details  that  cannot  be  described
       portably.

       The  pax  format  is intended for interchange, not only for backup on a
       single (family of) systems. It is not as densely  packed  as  might  be
       possible for backup:

             It  contains information as coded characters that could be coded
              in(1,8) binary.

             It identifies extended records with name fields  that  could  be
              omitted in(1,8) favor of a fixed-field layout.

             It translates names into a portable character set(7,n,1 builtins) and identifies
              locale-related information, both of which are probably  unneces-
              sary for backup.

       The  requirements  on  restoring from an archive are slightly different
       from the historical wording, allowing for non-monolithic  privilege  to
       bring  forward  as  much as possible. In particular, attributes such as
       "high performance file(1,n)" might be broadly but  not  universally  granted
       while  set-user-ID  or chown(1,2)(2) might be much more restricted. There is
       no implication in(1,8) IEEE Std 1003.1-2001 that the security information be
       honored  after  it  is restored to the file(1,n) hierarchy, in(1,8) spite of what
       might be improperly inferred by the silence on that topic.  That  is  a
       topic for another standard.

       Links  are recorded in(1,8) the fashion described here because a link(1,2) can be
       to any file(1,n) type. It is desirable in(1,8) general to be able to restore part
       of an archive selectively and restore all of those files completely. If
       the data is not associated with each link(1,2), it is  not  possible  to  do
       this.  However,  the data associated with a file(1,n) can be large, and when
       selective restoration is not needed, this can be a significant  burden.
       The  archive  is  structured so that files that have no associated data
       can always be restored by the name of any link(1,2) name of  any  link(1,2),  and
       the  user  may  choose whether data is recorded with each instance of a
       file(1,n) that contains data. The format permits mixing  of  both  types  of
       links  in(1,8) a single archive; this can be done for special needs, and pax
       is expected to interpret such archives on input properly,  despite  the
       fact  that  there  is no pax option that would force this mixed case on
       output. (When -o linkdata is used, the output must contain  the  dupli-
       cate data, but the implementation is free to include it or omit it when
       -o linkdata is not used.)

       The time(1,2,n) values are included  as  extended  header  records  for  those
       implementations  needing  more  than the eleven octal digits allowed by
       the ustar format. Portable file(1,n) timestamps cannot be negative.  If  pax
       encounters  a  file(1,n) with a negative timestamp in(1,8) copy or write(1,2) mode, it
       can reject the file(1,n), substitute a non-negative timestamp, or generate a
       non-portable  timestamp  with a leading granularities than seconds, the
       normative text requires  support  only  for  seconds  since  the  Epoch
       because the ISO POSIX-1 standard states them that way. The ustar format
       includes only mtime; the new format adds atime and ctime for  symmetry.
       The  atime  access(2,5) time(1,2,n) restored to the file(1,n) system will be affected by
       the -p a and -p e options. The ctime creation time(1,2,n) (actually inode mod-
       ification  time(1,2,n))  is  described with "appropriate privilege" so that it
       can be ignored when writing to the file(1,n) system. POSIX does not  provide
       a  portable  means to change file(1,n) creation time. Nothing is intended to
       prevent a non-portable implementation of pax from restoring the  value.

       The  gid,  size, and uid extended header records were included to allow
       expansion beyond the sizes specified in(1,8) the  regular  tar  header.  New
       file(1,n)  system  architectures are emerging that will exhaust the 12-digit
       size field. There are probably not many systems requiring more  than  8
       digits  for  user  and  group  IDs, but the extended header values were
       included for completeness, allowing overrides for all  of  the  decimal
       values in(1,8) the tar header.

       The  standard  developers intended to describe the effective results of
       pax with regard to file(1,n) ownerships and permissions; implementations are
       not  restricted  in(1,8)  timing or sequencing the restoration of such, pro-
       vided the results are as specified.

       Much of the text describing the  extended  headers  refers  to  use  in(1,8)
       "write(1,2)  or  copy modes". The copy mode references are due to the norma-
       tive text: "The effect of the copy shall be as if(3,n) the copied files were
       written  to an archive file(1,n) and then subsequently extracted ...". There
       is certainly no way to test whether  pax  is  actually  generating  the
       extended headers in(1,8) copy mode, but the effects must be as if(3,n) it had.


   pax Archive Character Set Encoding/Decoding
       There  is  a need to exchange archives of files between systems of dif-
       ferent native codesets. Filenames, group names, and user names must  be
       preserved to the fullest extent possible when an archive is read(2,n,1 builtins) on the
       receiving platform. Translation of the contents of files is not  within
       the scope of the pax utility.

       There will also be the need to represent characters that are not avail-
       able on the receiving platform. These unsupported characters cannot  be
       automatically  folded  to the local set(7,n,1 builtins) of characters due to the chance
       of collisions. This could  result  in(1,8)  overwriting  previous  extracted
       files from the archive or pre-existing files on the system.

       For  these reasons, the codeset used to represent characters within the
       extended header records of the pax archive must be sufficiently rich to
       handle  all commonly used character sets. The fields requiring transla-
       tion include, at a minimum, filenames, user  names,  group  names,  and
       link(1,2)  pathnames.  Implementations  may  wish to have localized extended
       keywords that use non-portable characters.

       The standard developers considered the following options:

             The archive creator  specifies  the  well-defined  name  of  the
              source  codeset.  The  receiver  must then recognize the codeset
              name and perform the appropriate translations to the destination
              codeset.

             The  archive  creator  includes within the archive the character
              mapping table for the source codeset  used  to  encode  extended
              header  records.  The receiver must then read(2,n,1 builtins) the character map-
              ping table and perform the appropriate translations to the  des-
              tination codeset.

             The  archive  creator  translates the extended header records in(1,8)
              the source codeset into a canonical form. The receiver must then
              perform the appropriate translations to the destination codeset.

       The approach that incorporates the name of the source codeset poses the
       problem  of codeset name registration, and makes the archive useless to
       pax archive decoders that do not recognize that codeset.

       Because parts of an archive may be corrupted, the  standard  developers
       felt  that  including  the  character map of the source codeset was too
       fragile. The loss of this one key component could result in(1,8) making  the
       entire  archive  useless.  (The  difference between this and the global
       extended header decision was that the latter has a workaround-duplicat-
       ing  extended  header records on unreliable media-but this would be too
       burdensome for large character set(7,n,1 builtins) maps.)

       Both of the above approaches also put an undue burden on  the  pax  ar-
       chive  receiver  to handle the cross-product of all source and destina-
       tion codesets.

       To simplify the translation from the source codeset  to  the  canonical
       form  and from the canonical form to the destination codeset, the stan-
       dard developers decided that the internal representation  should  be  a
       stateless  encoding.  A  stateless encoding(3,n) is one where each codepoint
       has the same meaning, without regard to the decoder being in(1,8) a specific
       state.  An  example of a stateful encoding(3,n) would be the Japanese Shift-
       JIS; an example of a stateless encoding(3,n) would be the  ISO/IEC  646:1991
       standard (equivalent to 7-bit ASCII).

       For these reasons, the standard developers decided to adopt a canonical
       format for the representation of file(1,n) information strings. The obvious,
       well-endorsed  candidate is the ISO/IEC 10646-1:2000 standard (based in(1,8)
       part on Unicode), which can be used to represent the characters of vir-
       tually  all  standardized  character sets. The standard developers ini-
       tially agreed upon using UCS2 (16-bit Unicode) as the  internal  repre-
       sentation.  This  repertoire of characters provides a sufficiently rich
       set(7,n,1 builtins) to represent all commonly-used codesets.

       However, the standard developers found that the 16-bit  Unicode  repre-
       sentation  had some problems. It forced the issue of standardizing byte
       ordering. The 2-byte length of each character made the extended  header
       records  twice as long for the case of strings coded entirely from his-
       torical 7-bit ASCII. For these reasons, the standard  developers  chose
       the UTF-8 defined in(1,8) the ISO/IEC 10646-1:2000 standard. This multi-byte
       representation encodes UCS2 or UCS4 characters reliably and determinis-
       tically,  eliminating  the need for a canonical byte ordering. In addi-
       tion, NUL octets and other characters possibly confusing to POSIX  file(1,n)
       systems  do not appear, except to represent themselves. It was realized
       that certain national codesets take up more space after  the  encoding(3,n),
       due  to their placement within the UCS range; it was felt that the use-
       fulness of the encoding(3,n) of the names outweighs the disadvantage of size
       increase for file(1,n), user, and group names.


       The encoding(3,n) of UTF-8 is as follows:


       UCS4 Hex Encoding   UTF-8 Binary Encoding
       00000000-0000007F   0xxxxxxx
       00000080-000007FF   110xxxxx 10xxxxxx
       00000800-0000FFFF   1110xxxx 10xxxxxx 10xxxxxx
       00010000-001FFFFF   11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
       00200000-03FFFFFF   111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
       04000000-7FFFFFFF   1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx

       where  each  'x' represents a bit value from the character being trans-
       lated.


   ustar Interchange Format
       The description of the ustar format reflects numerous enhancements over
       pre-1988  versions  of  the  historical  tar utility. The goal of these
       changes was not only to provide the  functional  enhancements  desired,
       but  also  to  retain  compatibility between new and old versions. This
       compatibility has been retained. Archives written using the old archive
       format are compatible with the new format.

       Implementors  should  be  aware  that  the previous file(1,n) format did not
       include a mechanism to archive directory type files. For  this  reason,
       the  convention  of  using  a filename ending with slash was adopted to
       specify a directory on the archive.

       The total size of the name and prefix fields have been set(7,n,1 builtins) to meet  the
       minimum  requirements  for {PATH_MAX} If a pathname will fit within the
       name field, it is recommended that the pathname be stored there without
       the use of the prefix field. Although the name field is known to be too
       small to contain {PATH_MAX} characters, the value was  not  changed  in(1,8)
       this version(1,3,5) of the archive file(1,n) format to retain backwards-compatibil-
       ity, and instead the prefix was introduced. Also, because of  the  ear-
       lier  version(1,3,5)  of the format, there is no way to remove the restriction
       on the linkname field being limited in(1,8) size to just that  of  the  name
       field.

       The  size  field  is  required  to  be meaningful in(1,8) all implementation
       extensions, although it could be zero. This is  required  so  that  the
       data blocks can always be properly counted.

       It  is  suggested  that  if(3,n) device special files need to be represented
       that cannot be represented in(1,8) the standard  format,  that  one  of  the
       extension  types (A-Z) be used, and that the additional information for
       the special file(1,n) be represented as data and be reflected  in(1,8)  the  size
       field.

       Attempting  to  restore  a  special file(1,n) type, where it is converted to
       ordinary data and conflicts with an existing filename, need not be spe-
       cially  detected by the utility. If run as an ordinary user, pax should
       not be able to overwrite the entries in(1,8), for example, /dev in(1,8) any  case
       (whether  the  file(1,n)  is  converted to another type or not). If run as a
       privileged user, it should be able to do so, and it would be considered
       a  bug if(3,n) it did not. The same is true of ordinary data files and simi-
       larly named(5,8) special files; it is impossible to anticipate the needs  of
       the user (who could really intend to overwrite the file(1,n)), so the behav-
       ior should be predictable (and thus regular) and rely on the protection
       system as required.

       The  value 7 in(1,8) the typeflag field is intended to define how contiguous
       files can be stored in(1,8) a ustar archive.  IEEE Std 1003.1-2001 does  not
       require  the  contiguous file(1,n) extension, but does define a standard way
       of archiving such files so that all conforming  systems  can  interpret
       these  file(1,n)  types  in(1,8)  a meaningful and consistent manner. On a system
       that does not support extended file(1,n) types, the pax  utility  should  do
       the best it can with the file(1,n) and go on to the next.

       The  file(1,n)  protection  modes are those conventionally used by the ls(1)
       utility. This is extended beyond the usage in(1,8) the ISO POSIX-2  standard
       to  support  the "shared text" or "sticky" bit. It is intended that the
       conformance document should not document anything beyond the  existence
       of  and  support  of  such  a mode.  Further extensions are expected to
       these bits, particularly with  overloading  the  set-user-ID  and  set-
       group-ID flags.


   cpio Interchange Format
       The  reference to appropriate privilege in(1,8) the cpio format refers to an
       error(8,n) on standard output; the ustar format  does  not  make  comparable
       statements.

       The  model  for  this  format  was the historical System V cpio -c data
       interchange format. This model documents the portable  version(1,3,5)  of  the
       cpio  format  and  not  the  binary  version. It has the flexibility to
       transfer data of any type described within IEEE Std 1003.1-2001, yet is
       extensible  to  transfer  data types specific to extensions beyond IEEE
       Std 1003.1-2001 (for example, contiguous files). Because  it  describes
       existing practice, there is no question of maintaining upwards-compati-
       bility.


   cpio Header
       There has been some concern that the size of the  c_ino  field  of  the
       header  is too small to handle those systems that have very large inode
       numbers. However, the c_ino field in(1,8) the header is used strictly  as  a
       hard-link  resolution mechanism for archives. It is not necessarily the
       same value as the inode number of the file(1,n) in(1,8) the location  from  which
       that file(1,n) is extracted.

       The name c_magic is based on historical usage.


   cpio Filename
       For  most  historical  implementations  of the cpio utility, {PATH_MAX}
       octets can be used to describe the pathname without the addition of any
       other  header  fields  (the  NUL  character  would  be included in(1,8) this
       count).  {PATH_MAX} is the minimum value for pathname size,  documented
       as  256  bytes. However, an implementation may use c_namesize to deter-
       mine the exact length of the pathname.  With the current description of
       the  <cpio.h>  header,  this  pathname size can be as large as a number
       that is described in(1,8) six octal digits.

       Two values are documented under the c_mode field values to provide  for
       extensibility for known file(1,n) types:

       0110 000
              Reserved  for contiguous files. The implementation may treat the
              rest of the information for this archive like a regular file. If
              this  file(1,n)  type is undefined, the implementation may create the
              file(1,n) as a regular file.

       This provides for extensibility of the cpio format while  allowing  for
       the  ability to read(2,n,1 builtins) old archives. Files of an unknown type may be read(2,n,1 builtins)
       as "regular files" on some implementations. On a system that  does  not
       support  extended file(1,n) types, the pax utility should do the best it can
       with the file(1,n) and go on to the next.


FUTURE DIRECTIONS
       None.


End of informative sections.
______________________________________________________________________________



SEE ALSO
       Shell Command Language, cp(1), ed(1), getopts(1), ls(1), printf(1,3,1 builtins)(3), the
       Base Definitions volume of IEEE Std 1003.1-2001, <cpio.h>,  the  System
       Interfaces   volume   of  IEEE  Std  1003.1-2001,  chown(1,2)(2),  creat(2),
       mkdir(1,2)(2), mkfifo(1,3)(2), stat(1,2)(2), utime(2), write(1,2)(2).


CHANGE HISTORY
       First released in(1,8) Issue 4.


   Issue 5
       A note is added to the APPLICATION USAGE indicating that the  cpio  and
       tar formats can only support files up to 8 gigabytes in(1,8) size.


   Issue 6
       The pax utility is aligned with the IEEE P1003.2b draft standard:

             Support  has  been  added  for symbolic links in(1,8) the options and
              interchange formats.

             A new format has been devised, based on extensions to ustar.

             References to the "extended" tar and cpio formats  derived  from
              the  POSIX.1-1990  standard  have  been  changed  to  remove the
              "extended" adjective because this could cause confusion with the
              extended  tar  header added in(1,8) this revision. (All references to
              tar are actually to ustar.)

       The TZ entry is added to the ENVIRONMENT VARIABLES section.

       IEEE PASC  Interpretation  1003.2  #168  is  applied,  clarifying  that
       mkdir(1,2)(2) and mkfifo(1,3)(2) calls can ignore an [EEXIST] error(8,n) when extract-
       ing an archive.

       IEEE  PASC  Interpretation  1003.2  #180  is  applied,  clarifying  how
       extracted files are created when in(1,8) read(2,n,1 builtins) mode.

       IEEE  PASC  Interpretation  1003.2  #181  is  applied,  clarifying  the
       description of the -t option.

       IEEE PASC Interpretation 1003.2 #195 is applied.

       IEEE PASC Interpretation 1003.2 #206 is applied,  clarifying  the  han-
       dling of links for the -H, -L, and -l options.

       IEEE  Std 1003.1-2001/Cor 1-2002, item XCU/TC1/D6/35 is applied, adding
       the process ID of the pax process into certain fields. This change pro-
       vides  a  method  for  the  implementation  to  ensure  that  different
       instances of pax extracting a file(1,n) named(5,8) /a/b/foo will not collide when
       processing the extended header information associated with foo.

       IEEE  Std 1003.1-2001/Cor 1-2002, item XCU/TC1/D6/36 is applied, chang-
       ing -x B to -x pax in(1,8) the OPTIONS section.

       IEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/20 is applied,  updat-
       ing the SYNOPSIS to be consistent with the normative text.

       IEEE  Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/21 is applied, updat-
       ing the DESCRIPTION to describe the behavior when files  to  be  linked
       are  symbolic  links and the system is not capable of making hard links
       to symbolic links.

       IEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/22 is applied,  updat-
       ing  the  OPTIONS  section  to  describe  the behavior for how multiple
       options are to be handled.

       IEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/23 is applied,  updat-
       ing the write(1,2) option within the OPTIONS section.

       IEEE  Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/24 is applied, adding
       a paragraph into the OPTIONS section that states that  specifying  more
       than  one  of the mutually-exclusive options (-H and -L) is not consid-
       ered an error(8,n) and that the last option  specified  will  determine  the
       behavior of the utility.

       IEEE  Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/25 is applied, remov-
       ing the ctime paragraph within the EXTENDED DESCRIPTION.   There  is  a
       contradiction  in(1,8)  the  definition  of  the  ctime  keyword for the pax
       extended header, in(1,8) that the st_ctime member of the stat(1,2) structure does
       not refer to a file(1,n) creation time. No field in(1,8) the standard stat(1,2) struc-
       ture from <sys/stat.h> includes a file(1,n) creation time.

       IEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/26 is applied,  making
       it  clear(1,3x,3x clrtobot)  that  typeflag  1 RB ( ustar Interchange Format) applies not
       only to files that are hard-linked, but also to files that are  aliased
       via symlinks.

       IEEE  Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/27 is applied, clari-
       fying the cpio c_nlink field.

       End of quoted text from the POSIX.1-2001 standard.

OPTIONS
       The following other options are implemented as extension to  the  POSIX
       standard:

       -help  Prints  a  summary of the most important options for spax(1) and
              exits.

       -xhelp Prints a summary of the less(1,3) important options for  spax(1)  and
              exits.

       -version
              Prints the spax version(1,3,5) number string(3,n) and exists.


EXAMPLES
ENVIRONMENT
FILES
SEE ALSO
DIAGNOSTICS
NOTES
       The  Institute  of  Electrical  and  Electronics Engineers and The Open
       Group, have given us permission to reprint portions of their documenta-
       tion.  In  the  following statement, the phrase ``this text'' refers to
       portions of the system documentation.

       Portions of this text are reprinted and reproduced in(1,8)  electronic  form
       in(1,8)  the  sfind manual, from IEEE Std 1003.1, 2004 Edition, Standard for
       Information Technology -- Portable Operating System Interface  (POSIX),
       The  Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by
       the Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In  the event of any discrepancy between these versions and the
       original IEEE and The Open Group Standard, the original  IEEE  and  The
       Open  Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html.

BUGS
AUTHOR
       Joerg Schilling
       Seestr. 110
       D-13353 Berlin
       Germany

       Mail bugs and suggestions to:

       schilling@fokus.fraunhofer.de      or       js@cs.tu-berlin.de       or
       joerg@schily.isdn.cs.tu-berlin.de



Joerg Schilling                    05/01/17                           SPAX(1L)

References for this manual (incoming links)