Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

10.0;cpf (copy_file), revision 1.0, 88/01/18
cpf (copy_file) -- Copy a file.
usage: cpf source_pathname [target_ pathname] [-c|-r] [-chn]
                        [-p] [-f] [-lf]
                        [-ldl] [-du]
                        [-dacl|-sacl]
                        [-subs|-nsubs]
                        [-pdt] [-cwl]
                        [-conv]



DESCRIPTION
     cpf copies a file from the source pathname to the target pathname. cpf
     copies only files; see cpt (copy_tree) for copying directories and their
     subordinate objects.

     Multiple source/target pairs and pathname wildcarding are permitted.


ARGUMENTS
     source_pathname (required)
                    Specify file to be copied. If the source pathname is a
                    link name, cpf resolves the link and copies the file to
                    which the link refers.

     target_pathname  (optional)
                    Specify target for copy. If target_pathname is a
                    directory, source_pathname is copied into this directory.
                    The target must not be a link.

                    Default if omitted:
                                   copy source_pathname into current working
                                   directory

     Multiple source/target pairs and pathname wildcarding are permitted,
     however while you can use a wildcard with the source argument, you cannot
     with the destination.


OPTIONS
     -p[airwise]    Instructs cpf to accept the list of tokens as consecutive
                    pairs. This is necessary whether you are using wildcards
                    or not.

     -c (default)   Create source file at target.  An error occurs if the
                    target file already exists.

     -r             Replace target with copy of source.

     -lf            List files copied.

     -ldl           List files deleted as a result of a replace (-r).

     -chn           Use with -c to change the name of an existing object with
                    the target pathname before the copy is made.  Use with -r
                    to change the name of a target file if it is in use and
                    cannot be deleted.

     -dacl (default)
                    Apply the target directory's default ACL for files copied.
                    In addition to its own ACL, each directory has two default
                    ACLs,  one for its files and another for its
                    subdirectories. The system assigns the parent directory's
                    default ACL for files to the target file unless you
                    specify -sacl or the file belongs to a protected subsystem
                    (see the -subs option),

     -sacl          Retain the source file's ACL.

     -subs (default)
                    Retain source ACL for objects that belong to subsystems.

     -nsubs         Apply the target directory's default ACL for objects that
                    belong to subsystems.

     -f             Force deletion of target object if 'p' rights are present.

     -du            Delete when unlocked.  This option is useful with -r.  If
                    the object to be replaced is locked when cpf is invoked,
                    the replace operation is performed when the object is
                    unlocked.

     -pdt           Preserve the source file's modification and used times.

     -cwl           Obtain a co-writer's instead of an exclusive lock on files
                    being copied.

     -conv[ert]     Set the owner entry in the target from the first
                    person.%.% entry in the source with P rights.  The first
                    %.group.% entry in the source becomes the group entry in
                    the target, and the first %.%.org entry in the source
                    becomes the organization entry in the target.

                    Used with the -conv option, cpf, cpt, and acl duplicate
                    Domain/IX behavior.  Their default behavior is to turn
                    SR9.7 ACLs into SR10 extended entries.  For more
                    information on SR10 behavior, see Managing Aegis System
                    Software.

NOTES
     If you use more than one pair of name tokens with this command, you must
     use the -p option. It instructs the command to accept the list of tokens
     as consecutive pairs. This is necessary whether you are using wildcards
     or not. In the past, this command has correctly paired off tokens without
     the prompting of a switch; now the -p switch must be used to acheive this
     result.  The switch has been added to protect against inadvertent use in
     a shell, other than /com/sh, where wildcard expansion can be a problem.

EXAMPLES
     Copy the file wbak from the latest directory to the current directory,
     and call it wbak.latest

     $ cpf /latest/wbak wbak.latest
     $


     Copy the file latest/com/wbak to the com directory, replacing the
     existing com/wbak

     $ cpf /latest/com/wbak /com -r
     $


     Copy and list all files in the games directory starting with space, to
     the working directory.

     $ cpf /games/space?* -lf
     (file)  "space_war" copied.
     (file)  "space_walk" copied.
     (file)  "space_shot" copied.
     $


     Copy all files in the working  directory with the suffix .pas to the
     directory backup, and append a date.

     $ cpf ?*.pas backup/=.12.07
     $

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