cp(1) MPE/iX Shell and Utilities cp(1)
______________________________________________________________________
NAME
cp -- copy files
SYNOPSIS
cp [-cfimp] file1 file2
cp [-fimp] file... directory
cp -R [-fimp] source... directory
cp -r [-fimp] source... directory
DESCRIPTION
Note: The MPE/iX implementation of this utility does not function
exactly as this man page describes. For details, see the MPE/iX
NOTES section at the end of this man page.
cp copies files to a target named by the last argument on its
command line. If the target is an existing file, cp overwrites
it; if it does not exist, cp creates it. If the target file
already exists and does not have write permission, cp denies
access and continues with the next copy.
If you specify more than two path names, the last path name (that
is, the target) must be a directory. If the target is a direc-
tory, cp copies the sources into that directory with names given
by the final component of the source path name.
Options
cp accepts the following options:
-f attempts to replace files which do not have write permis-
sion.
-i asks you if you want to overwrite an existing file, whether
or not the file is read-only.
-m sets the modify and access time of each destination file to
that of the corresponding source file. Normally, cp sets
the modification time of the destination file to the
present.
-p preserves the modify and access times (like the -m option);
in addition, it preserves file mode, owner, and group owner,
if possible.
-R clones the source trees. cp copies all the files and sub-
directories specified by source.... into directory , making
careful arrangements to duplicate special files (FIFO, block
special, character special).
-r clones the source trees, but makes no allowances for special
files (FIFO, block special, character special). Conse-
quently, cp attempts to read from a device rather than
duplicate the special file. This is similar to, but less
1
cp(1) MPE/iX Shell and Utilities cp(1)
______________________________________________________________________
useful than, the preferred -R.
DIAGNOSTICS
Possible exit status values are:
0 Successful completion.
1 Failure due to any of the following:
-- an argument had a trailing slash (/) but was not a directory
-- unable to find a file
-- unable to open an input file for reading
-- unable to create or open an output file
-- a read error occurred on an input file
-- a write error occurred on an output file
-- the input and output files were the same file
-- encountered a fatal error when using -r or -R.
Possible fatal -r or -R errors include:
-- inability to access a file
-- inability to change permissions on a target file
-- inability to read a directory
-- inability to create a directory
-- a target which is not a directory
-- source and destination directories are the same.
2 Failure due to any of the following:
-- an invalid command line option
-- too few arguments on the command line
-- a target that should be a directory but isn't
-- no space left on target device
-- out of memory to hold the data to be copied
-- inability to create a directory to hold a target file
Messages
Message: cannot allocate I/O buffer: system error
Cause: See syserror(3).
Action: See syserror(3).
Message: cannot allocate target string
Cause: cp has no space to hold the name of the target file.
Action: Free up more system resources.
Message: cannot create parent directory for target "name"
Cause: An error occurred while trying to create the parent
directory of the specified target file.
Action: Make sure that you have permissions to create the
directory.
2
cp(1) MPE/iX Shell and Utilities cp(1)
______________________________________________________________________
Message: cannot find file "filename"
Cause: You specified a filename that does not exist.
Action: Check the path and spelling of filename.
Message: cannot mkdir "pathname": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: cannot open file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: Cannot reset permissions on file "filename": system err
or"
Cause: See syserror(3).
Action: See syserror(3).
Message: Cannot reset times on file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: Cannot reset uid or gid on file "filename": system erro
r"
Cause: See syserror(3).
Action: See syserror(3).
Message: copy of filename failed (CIERR num)
Cause: An error occurred while using the MPE/iX CI COPY com-
mand to copy a non-byte stream file.
Action: Refer to the MPE/iX Reference Supplement (32650-90353)
for more information.
Message: fifo "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: no space on device for file "filename"
Cause: You attempted to copy a file to filename on a device
that has no space for it.
Action: Free up space on the target device or copy the file to
another device.
Message: read error on file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: recursive copy to directory "pathname"
Cause: You tried to recursively copy a directory to itself.
Action: Choose a different pathname.
3
cp(1) MPE/iX Shell and Utilities cp(1)
______________________________________________________________________
Message: source "name" and target "name" are identical
Cause: You specified source and target files that are actually
the same file (for example, because of links).
Action: No further action is required.
Message: special file "filename"system error
Cause: See syserror(3).
Action: See syserror(3).
Message: stat error for "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: target file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: target "pathname" is not a directory
Cause: When recursively copying multiple files using the -r or
-R option, the target must be a directory. You speci-
fied a target pathname that is not a directory.
Action: Check spelling of target pathname.
Message: target "pathname" must be a directory
Cause: You attempted to copy two or more files but the target
indicated by pathname was not a directory.
Action: When copying (or moving) two or more files, ensure that
the final name on the command line is a directory.
Message: target "pathname" must exist
Cause: The destination directory must exist for this utility
to work.
Action: Check the command line arguments. You may need to cre-
ate the target directory.
Message: Unknown option "-option"
Cause: You specified an option that is not valid for cp.
Action: Check the DESCRIPTION section of this man page for a
list of valid cp options.
Message: unreadable directory "pathname": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: write error on file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
4
cp(1) MPE/iX Shell and Utilities cp(1)
______________________________________________________________________
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems.
The -f and -m options are extensions to the POSIX standard.
MPE/iX NOTES
When copying byte stream files, cp performs in the POSIX-compli-
ant manner described in this man page. When copying non-byte
stream files, cp calls the MPE/iX CI COPY command to perform the
task. See the MPE/iX Reference Supplement (32650-90353) for
details on how the COPY command works.
On MPE/iX, cp is available as both a built-in shell utility and
an external utility.
For more information on how the current MPE/iX implementation may
affect the operation of this utility, see Appendix A, MPE/iX
Implementation Considerations.
SEE ALSO
cat(1), cpio(1), mv(1), rm(1)
5