Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pcpio(C) — OpenDesktop 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

find(C)

pax(C)

tar(C)

tar(F)


 pcpio(C)                      06 January 1993                       pcpio(C)


 Name

    pcpio - copy file archives in and out

 Syntax

    pcpio -o [ BLacv ]

    pcpio -i [ Bcdfmrtuv ] [ pattern ... ]

    pcpio -p [ aLdlmruv ] 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 creat-
    ed and copied into the current directory, and possibly any levels below,
    based upon the options described below. 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 retain the owner and group of the files of the pre-
    vious 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 255 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 with 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.

    -L      Follow symbolic links.

    -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 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 nota-
              tion 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 > /tmp/newfile

    copies out the files listed by the ls utility and redirects them to the
    file /tmp/newfile.

    The following command:

       cat /tmp/newfile | pcpio -id "memo/al" "memo/b*"

    uses the output file /tmp/newfile from the pcpio -o utility, takes those
    files that match the patterns memo/al and memo/b*, creates the direc-
    tories below the current directory, and places the files in the appropri-
    ate directories.

    The command

       find . -depth -print | pcpio -pdlmv newdir

    takes the filenames piped to it from the find utility and copies or links
    those files to another directory named newdir, while retaining the modif-
    ication 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) and tar(F).

 Notes

    When you use cpio commands with find, if you use the -L option with cpio,
    then you must use the -follow option with find and vice-versa.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026