HPlogo Commands Reference HP 3000 Series 9X8LX Computer Systems > Chapter 2 MPE/iX Commands

COPY

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Copies one file to another by creating a new file or by overwriting an existing file. This command can be used to copy files to and from HFS directories. Also, users with SM capabilities are able to copy files to MPE accounts outside of their current logon account.

Syntax



   COPY [FROM=]sourcefile[{;TO=

                        ,}targetfile][ASK

                                  YES

                                  NO ]

Parameters

sourcefile

The name of the file that is to be copied. A file with HFS syntax must begin with a dot (.), or a slash (/).

targetfile

The name of the file to which sourcefile is to be copied. If targetfile is omitted, the source file is copied to sourcefile in the user's current working directory (CWD). You may qualify targetfile with both file and group names, or specify only the destination group. If only group is specified, COPY puts a copy of the source file in a file called sourcefile in the specified group.

Since .groupname can be specified as the targetfile, and HFS file names can also start with a dot (.), this could lead to confusion as to whether an MPE group or HFS file name is desired for the targetfile. If the targetfile is an HFS filename starting with a dot (.), then the targetfile must be preceded with a dot and slash (./). For example, to represent a targetfile .FOO in an HFS current working directory, the file must be represented as ./.FOO.

ASK

If targetfile already exists, COPY prompts the user to choose an action with the following prompt:

   PURGE OLD targetfile?

Valid replies to this prompt are:

Y or YES

Instructs COPY to purge the original targetfile and create a new targetfile.

N or NO

Instructs COPY to terminate.

ASK is the default, except in a job or in other cases when the user is not using interactive mode. In such cases, ASK has no meaning, and YES becomes the default.

YES

Instructs COPY to purge targetfile if it already exists. No message is displayed for the user, as would be the case with ASK. YES is the default in jobs, or at other times when the user is not using an interactive mode.

NO

Instructs COPY to terminate if targetfile already exists.

You may not specify system-wide ($ prefix), CM KSAM, or privileged files as sourcefile or targetfile.

Operation Notes

This command performs a fast copy of sourcefile to targetfile and leaves sourcefile unchanged. Both files must be nonspooled disk files residing on the host system. You may specify files that are backreferenced with a file equation (*). However, this command only supports three file equation options: the file name, the final disposition (;TEMP or ;SAVE), and the disk volume or volume class (;DEV= DISC or ;DEV=<DISC LDEV NUMBER>). All other file equation options are ignored.

The file disposition of targetfile defaults to that of sourcefile. For example, if sourcefile is TEMP, targetfile is created TEMP. If sourcefile is PERM, targetfile is created as PERM. This file disposition can be overridden by using a file equation. This is one of the three options supported for file equations.

All file access attributes of the source file, including ACDs (access control definitions) are duplicated for the target file.

If a source file has an ACD, the ACD is copied to the target file. If a file does not have an ACD, and it is copied outside an MPE group, it is automatically assigned an ACD.

Use

This command may be invoked from a session, a job, a program, or in break mode. Pressing Break aborts the execution of this command and purges the targetfile.

The COPY command can be invoked in break mode and does not suffer from process creation overhead.

NOTE: The targetfile max extent value may not be the same as for sourcefile.Directories cannot be copied using the COPY command. If sourcefile or targetfile is actually a directory, an error is returned.

CM files and temporary files cannot be copied to HFS directories.

Examples

To copy ABCD.logongroup to EFG.logongroup, enter:

   COPY ABCD, EFG

To copy ABCD.logongroup to ABCD.newgroup, enter:

   COPY ABCD, .newgroup

To copy ABCD.grp to ABCD.logongroup, enter:

   COPY ABCD.grp

In the next example the file MYFILE.PUB.SYS is copied to MyFile under the current working directory (CWD). Note that the target file name has to have the dot and slash (./) prefix.

   COPY myfile.pub.sys, ./MyFile

In the next example, the file File1 under the CWD is copied to MYFILE.PUB in the current account.

   COPY ./File1, myfile.pub

In the next example, file1 in directory dir0 is copied to file2 in directory dir1.

   COPY ./dir0/file1, ./dir1/file2

In the following example, the file TEST has a lockword which is the word LOCK. The file is copied into file1 in the dir0 directory.

   COPY TEST/LOCK, ./dir0/file1

The following example copies the file /a/b/file to the CWD as "file". For example, if your CWD is /ACCT/GRP, then the copied file will be named /ACCT/GRP/file.

   COPY /a/b/file

Related Commands



   FCOPY
Feedback to webmaster