Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pcpio(C) — OpenDesktop 2.0.0a

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

find(C)

pax(C)

tar(C)

tar(F)


 pcpio(C)                        19 June 1992                        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 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.

    -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 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.

 File

    /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)

 Note

    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.

 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 MER-
    CHANTIBILITY 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-1990 System Application Program Interface (API) [C
    Language] (ISO/IEC 9945-1);
    and NIST FIPS 151-1.


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