cpio(1)
_________________________________________________________________
cpio Command
copy file archives in and out
_________________________________________________________________
SYNTAX
cpio -o [ achsuBV ] [ -C (record size) ] [ -O (filename) ]
cpio -i [ bcdmfrstuvBSV6 ] [ -C (record size) ] [ -I (filename) ]
[ patterns ]
cpio -p [ adhlmuvLV ] directory
cpio -i [ B [ block size] cCdhmrtuvVfsISb6 ] [ patterns ]
cpio -p [ aCdhlLmruvV ] directory
DESCRIPTION
Cpio -o (copy out) reads the standard input to get a list of
pathnames and copies those files onto the standard output
together with path name and status information. Output is padded
to a 512-byte boundary. DG cpio produces unswapped binary
headers by default.
Cpio -i (copy in) extracts files from the standard input, which
is assumed to be the product of a previous cpio -o. Only files
with names that match patterns are selected. Cpio will
automatically determine whether the archive is in default binary
header format or in ASCII (-c option) header format. Also, it
will match the byte order of the headers. However, if you use
the -c option to create an archive, you must use the -c option to
read that archive.
Patterns are given in the name-generating notation of sh(1). In
patterns, meta-characters ?, *, and [...] match the slash /
character. You can specify more than one pattern. If no patterns
are specified, the default for patterns is * (i.e., select all
files). The extracted files are conditionally created and copied
into the current directory tree based upon the options described
below.
The permissions of the files will be those of the previous cpio
-o. The owner and group of the files will be that of the current
user, unless the user is super-user, which causes cpio to retain
the owner and group of the files of the previous cpio -o.
Cpio -p (pass) reads the standard input to get a list of
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
cpio(1)
pathnames of files that are conditionally created and copied into
the destination directory tree, based on the options described
below.
When extracting files, a special field in the header determines
whether or not the input is readable and allows cpio to match the
header format of the input. However, cpio cannot determine the
byte order of the file data; you must use the -s -S, or -b
option if you want data reorganization to be done.
When using arguments, you must position the arguments in the same
order as the options. The options are:
a Reset access times of input files after they have been
copied.
B Input/output is to be blocked 5,120 bytes to the record
(does not apply to the pass option; meaningful only with
data directed to or from /dev/rmt/??).
d Directories are to be created as needed.
c Write header information in ASCII character form for
portability.
r Interactively rename files. If you type a null line, the
file is skipped.
t Print a table of contents of the input. No files are
created.
u Copy unconditionally (normally, an older file will not
replace a newer file with the same name).
v Verbose: prints a list of filenames. When used with the t
option, the table of contents looks like the output of an
ls -l command (see ls(1)).
l Whenever possible, link files rather than copying them.
Usable only with the -p option.
m Retain previous file modification time. Ineffective on
directories that are being copied.
f Copy in all files except those in patterns.
s Swap data bytes. Use only with the -i option.
S Swap data halfwords. Use only with the -i option.
b Swap both data bytes and data halfwords. Use only with the
-i option.
h Do not handle symbolic links; use what the link points to
instead.
L Create symbolic links instead of copying file. (This
option can be used only with the -p option.)
O <f>
Write the output to file f. (This option can be used only
with the -o option.)
I <f>
Read the input from the file f. (This option can be used
only with the -i option.)
V Print a period for each file processed.
C <n>
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
cpio(1)
Record size is n bytes.
6 Process a file that is in UNIX Version Sixth Edition format.
Useful only with -i (copy in).
NOTE:
cpio assumes four-byte words.
If cpio reaches end of medium (end of a diskette for example),
when writing to (-o) or reading from (-i) a character special
device, cpio will print the message:
If you want to go on, type device/file name when ready.
To continue, you must replace the medium and type the character
special device name (/dev/rmt/c22d0 for example) and carriage
return. You may want to continue by directing cpio to use a
different device. For example, if you have two tape drives you
may want to switch between them so cpio can proceed while you are
changing the tapes. (A carriage return alone causes the cpio
process to exit.)
_________________________________________________________________
EXAMPLES
$ ls *.c | cpio -oB >/dev/rmt/0n
This example copies all files in the working directory with the
.c extension to the tape on /dev/rmt/0n. The -B option blocks
the tape at 5120 bytes/record and writing the file to /dev/rmt/0n
leaves the tape positioned at end-of-file (instead of rewinding
it). For information on tape positioning, see "Appendix A" in
Installing and Managing the DG/UX System.
$ cat namelist
bad_prog.c
big_prog.c
prog.c
$ cpio -ov < namelist > /dev/rmt/0
bad_prog.c
big_prog.c
prog.c
5 blocks
In this example cpio uses the contents of the file name_list as a
guide for what files to dump. When the -v switch is used, cpio
displays on the screen the names of the files it succesfully
dumps. Since the -B switch isn't used the blocking factor will
be 512 bytes/record.
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)
cpio(1)
$ cat /dev/rmt/0n > /dev/null
$ cpio -iub < /dev/rmt/0
The cat command above positions the tape drive read/write head at
the beginning of the next tape file. The cpio command then reads
in that next tape file. When using the -u switch with the cpio
command, all files on the tape will over-write any existing files
with the same name.
_________________________________________________________________
SEE ALSO
ar(1), find(1), ls(1).
cpio(4) in the Programmer's Reference for the DG/UX System
NOTES
Path names are restricted to 256 characters. If there are too
many unique linked files, the program runs out of memory to keep
track of them and, thereafter, linking information is lost. Only
the superuser can copy special files. The default header format
is an unportable binary format; the -c option must be used to
guarantee portability.
DG/UX 4.00 Page 4
Licensed material--property of copyright holder(s)