PCPIO(C) UNIX System V
Name
pcpio - copy file archives in and out
Syntax
pcpio -o[Bacv]
pcpio -i[Bcdfmrtuv] [pattern...]
pcpio -p[adlmruv] directory
Description
The pcpio utility produces and reads files in the format
specified by the cpio Archive/Interchange File Format
specified in IEEE Std. 1003.1-1988.
The pcpio -i (copy in) utility extracts files from the
standard input, which is assumed to be the product of a
previous pcpio -o . Only files with names that match
patterns are selected. Multiple patterns may be specified
and if no patterns are specified, the default for patterns
is selecting all files. The extracted files are
conditionally created and copied into the current directory,
and possibly any levels below, based upon the options
described below and the permissions of the files will be
those of the previous pcpio -o . The owner and group of the
files will be that of the current user unless the user has
appropriate privileges, which causes pcpio to retains the
owner and group of the files of the previous pcpio -o .
The pcpio -p (pass) utility reads the standard input to
obtain a list of path names of files that are conditionally
created and copied into the destination directory based upon
the options described below.
If an error is detected, the cause is reported and the pcpio
utility will continue to copy other files. pcpio will skip
over any unrecognized files which it encounters in the
archive.
The following restrictions apply to the pcpio utility:
1 Pathnames are restricted to 256 characters.
2 Appropriate privileges are required to copy special files.
3 Blocks are reported in 512-byte quantities.
Options
The following options are available:
-B Input/output is to be blocked 5120 bytes to the record.
Can only be used with pcpio -o or pcpio -i for data
that is directed to or from character special files.
-a Reset access times of input files after they have been
copied. When the -l option is also specified, the
linked files do not have their access times reset. Can
only be used with pcpio -o or pcpio -i .
-c Write header information in ASCII character for for
portability. Can only be used with pcpio -i or pcpio
-o . Note that this option should always be used to
write portable files.
-d Creates directories as needed. Can only be used with
pcpio -i or pcpio -p .
-f Copy in all files except those in patterns . Can only
be used with pcpio -i .
-l Whenever possible, link files rather than copying them.
Can only be used with pcpio -p .
-m Retain previous modification times. This option is
ineffective on directories that are being copied. Can
only be used with pcpio -i or pcpio -p .
-r Interactively rename files. The user is asked whether
to rename pattern each invocation. Read and write
permissions for /dev/tty are required for this option.
If the user types a null line, the file is skipped.
Should only be used with pcpio -i or pcpio -o .
-t Print a table of contents of the input. No files are
created. Can only be used with pcpio -i .
-u Copy files unconditionally; usually an older file will
not replace a new file with the same name. Can only be
used with pcpio -i or pcpio -p .
-v Verbose: cause the names of the affected files to be
printed. Can only be used with pcpio -i . Provides a
detailed listing when used with the -t option.
Operands
The following operands are available:
patterns Simple regular expressions given in the name-
generating notation of the shell.
directory The destination directory.
Exit Status
The pcpio utility exits with one of the following values:
0 All input files were copied.
2 The utility encountered errors in copying or accessing
files or directories. An error will be reported for
nonexistent files or directories, or permissions that
do not allow the user to access the source or target
files.
It is important to use the -depth option of the find utility
to generate pathnames for pcpio . This eliminates problems
pcpio could have trying to create files under read-only
directories.
The following command:
ls | pcpio -o > ../newfile
copies out the files listed by the ls utility and redirects
them to the file newfile .
The following command:
cat newfile | pcpio -id "memo/al" "memo/b*"
uses the output file newfile from the pcpio -o utility,
takes those files that match the patterns memo/al and
memo/b* , creates the directories below the current
directory, and places the files in the appropriate
directories.
The command
find . -depth -print | pcpio -pdlmv newdir
takes the file names piped to it from the find utility and
copies or links those files to another directory named
newdir , while retaining the modification time.
Files
/dev/tty used to prompt the user for information when the
-i or -r options are specified.
See Also
find(C), pax(C), tar(C), tar(F)
Copyright
Copyright (c) 1989 Mark H. Colburn.
All rights reserved.
Redistribution and use in source and binary forms are
permitted provided that the above copyright notice is
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was
developed by Mark H. Colburn and sponsored by The USENIX
Association.
THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A
PARTICULAR PURPOSE.
Author
Mark H. Colburn
NAPS International
117 Mackubin Street, Suite 1
St. Paul, MN 55102
mark@jhereg.MN.ORG
Sponsored by The USENIX Association for public distribution.
Standards Conformance
pcpio is conformant with:
IEEE POSIX Std 1003.1-1988 with C Standard Language-
Dependent System Support;
and NIST FIPS 151-1.
(printed 2/15/90) PCPIO(C)