PAX(1) BSD General Commands Manual PAX(1)
NAME
opax -- read and write file archives and copy directory hierarchies (OpenBSD pax implementation)
SYNOPSIS
opax [-0cdOnvz] [-f archive] [-s replstr] ... [-U user] ... [-G group] ... [-T [from_date] [,to_date]] ... [pattern ...]
opax -r [-cdiknuvzDOYZ] [-f archive] [-o options] ... [-p string] ... [-s replstr] ... [-E limit] [-U user] ... [-G group] ... [-T
[from_date] [,to_date]] ... [pattern ...]
opax -w [-0dituvzHLOPX] [-b blocksize] [[-a] [-f archive]] [-x format] [-s replstr] ... [-o options] ... [-U user] ... [-G group] ...
[-B bytes] [-T [from_date] [,to_date] [/[c][m]]] ... [file ...]
opax -r -w [-0diklntuvDHLOPXYZ] [-p string] ... [-s replstr] ... [-U user] ... [-G group] ... [-T [from_date] [,to_date] [/[c][m]]] ...
[file ...] directory
DESCRIPTION
opax will read, write, and list the members of an archive file, and will copy directory hierarchies. opax operation is independent of the
specific archive format, and supports a wide variety of different archive formats. A list of supported archive formats can be found under
the description of the -x option.
The presence of the -r and the -w options specifies which of the following functional modes opax will operate under: list, read, write, and
copy.
<none> List. opax will write to standard output a table of contents of the members of the archive file read from standard input, whose
pathnames match the specified patterns. The table of contents contains one filename per line and is written using single line
buffering.
-r Read. opax extracts the members of the archive file read from the standard input, with pathnames matching the specified patterns.
The archive format and blocking is automatically determined on input. When an extracted file is a directory, the entire file hierar-
chy rooted at that directory is extracted. All extracted files are created relative to the current file hierarchy. The setting of
ownership, access and modification times, and file mode of the extracted files are discussed in more detail under the -p option.
-w Write. opax writes an archive containing the file operands to standard output using the specified archive format. When no file op-
erands are specified, a list of files to copy with one per line is read from standard input. When a file operand is also a direc-
tory, the entire file hierarchy rooted at that directory will be included.
-r -w Copy. opax copies the file operands to the destination directory. When no file operands are specified, a list of files to copy with
one per line is read from the standard input. When a file operand is also a directory the entire file hierarchy rooted at that
directory will be included. The effect of the copy is as if the copied files were written to an archive file and then subsequently
extracted, except that there may be hard links between the original and the copied files (see the -l option below).
Warning: The destination directory must not be one of the file operands or a member of a file hierarchy rooted at one of the file op-
erands. The result of a copy under these conditions is unpredictable.
While processing a damaged archive during a read or list operation, opax will attempt to recover from media defects and will search through
the archive to locate and process the largest number of archive members possible (see the -E option for more details on error handling).
The directory operand specifies a destination directory pathname. If the directory operand does not exist, or it is not writable by the
user, or it is not of type directory, opax will exit with a non-zero exit status.
The pattern operand is used to select one or more pathnames of archive members. Archive members are selected using the pattern matching
notation described by fnmatch(3). When the pattern operand is not supplied, all members of the archive will be selected. When a pattern
matches a directory, the entire file hierarchy rooted at that directory will be selected. When a pattern operand does not select at least
one archive member, opax will write these pattern operands in a diagnostic message to standard error and then exit with a non-zero exit sta-
tus.
The file operand specifies the pathname of a file to be copied or archived. When a file operand does not select at least one archive member,
opax will write these file operand pathnames in a diagnostic message to standard error and then exit with a non-zero exit status.
The options are as follows:
-r Read an archive file from standard input and extract the specified files. If any intermediate directories are needed in order to
extract an archive member, these directories will be created as if mkdir(2) was called with the bitwise inclusive OR of S_IRWXU,
S_IRWXG, and S_IRWXO as the mode argument. When the selected archive format supports the specification of linked files and these
files cannot be linked while the archive is being extracted, opax will write a diagnostic message to standard error and exit with a
non-zero exit status at the completion of operation.
-w Write files to the standard output in the specified archive format. When no file operands are specified, standard input is read for
a list of pathnames with one per line without any leading or trailing <blanks>.
-a Append files to the end of an archive that was previously written. If an archive format is not specified with a -x option, the for-
mat currently being used in the archive will be selected. Any attempt to append to an archive in a format different from the format
already used in the archive will cause opax to exit immediately with a non-zero exit status. The blocking size used in the archive
volume where writing starts will continue to be used for the remainder of that archive volume.
Warning: Many storage devices are not able to support the operations necessary to perform an append operation. Any attempt to append
to an archive stored on such a device may damage the archive or have other unpredictable results. Tape drives in particular are more
likely to not support an append operation. An archive stored in a regular file system file or on a disk device will usually support
an append operation.
-0 Use the NUL ('