COPY - copy contents of a file to another file.

Syntax:

copy [From=]infile [To=]outfile [option]*
(+|-)All (-)             (+|-)CHeck (+)
(+|-)CreateCatalogs (-)  (+|-)Equivalent (+)
(+|-)New (+)             (+|-)Old (+)
(+|-)Stop (+)            (+|-)Verbose(+)
Size=number              indeX=filename

Examples:

copy .h another/.h   <-- copies your .h to another/.h
copy .h another/     <-- copies your .h to another/.h
copy another from=.h <-- copies your .h to file another
copy another/.h /    <-- copies another/.h to your /.h

Options:

+All
copies the whole file, ignoring how much of the file is actually in use. The default is -All, in which case COPY inspects the contents of the file to determine how much is actually used, and copies just that. -All can result in substantial decrease in file size, for example, in the case of run-units.
-CHeck
lets you copy from random files to sequential files and vice versa.
+CreateCatalogs
creates any intervening catalogs needed for the output file. For example, suppose you try to copy a file into "user/newcat/file", but the "newcat" catalog doesn't currently exist. With +CreateCatalogs, COPY automatically creates the "newcat" catalog when it is needed. Any number of intervening catalogs will be created, if necessary.
-Equivalent
does not copy a file if there is an existing file with the same name and the two files are identical. With -Equivalent, COPY first compares the two files block by block; if the files are completely identical, the copy operation doesn't take place. This means that the existing file retains its previous change date. The files must be identical, including any "junk records" at the end of physical blocks. If COPY does not copy a file because it is the same as the destination file, COPY prints a message of the form
compared N llinks of text
-New
does not create a new file if "outfile" does not exist. Instead, COPY issues an error message.
-Old
does not copy over old files. If "outfile" already exists, COPY issues an error message and stops; the existing "outfile" is not touched.
-Verbose
does not display any message about the contents of the file copied.
From=infile
specifies the infile without use of positional parameters. Using From= does not necessitate using To=.
To=outfile
specifies the outfile without use of positional parameters. Using To= does not necessitate using From=.
Size=number
is the maximum number of llinks that are to be copied.
indeX=file
specifies an index file. Each line in the index file gives one COPY instruction (without the command name COPY). These lines may contain command line options, as in
infile1 outfile1
infile2 user/cat/outfile2 +cc
+v infile3 outfile3 s=30

If you specify an index file for a COPY command, the command line itself may not contain "[From=]infile" or "[To=]outfile". Any other options on the command line are taken as defaults for all copy operations specified by the index file; individual lines in the index file may specify options to override the defaults on the command line.

-Stop
is used in connection with indeX=file. Usually, if one copy operation in an index file runs into some kind of error, COPY stops without trying the remaining operations in the file. However, if you specify -Stop, COPY does not stop if an error occurs.

Description:

COPY copies "infile" into "outfile"; "infile" is not disturbed. COPY attempts to determine the contents of the file and to copy the actual amount used. COPY recognizes GFRC files, Hstar files, and Ranedit libraries. For all other file formats, the full file contents are copied.

You can copy a selected portion of a file using the Size= option. If you want to copy GFRC files with multiple EOF marks, specify +All; otherwise only the data up to the first EOF mark will be copied.

If "outfile" is the name of a catalog rather than a file, or if "outfile" ends in a "/" (for cases where it could be ambiguous), COPY places the output under that catalog in a file with the same name as "infile". For example,

copy cat1/abc cat2/

creates "cat2/abc".

By default, if "outfile" already exists, COPY overwrites the current contents; if the file doesn't already exist, COPY creates one. In other words, the default is "+Old +New". Using -Old tells COPY not to overwrite old files, and using -New tells COPY not to create a new file if an old one doesn't exist. +New automatically changes the default for the Old option to -Old. Similarly, +Old changes the default for the New option to -New.

Notes:

If the output file does not already exist and +New is in effect, COPY creates a file of the given name. If this is a permanent file, COPY will create it with the usual general read permission, and read-while-write access mode.

Due to a design flaw in TSS, COPY cannot create an output temporary file of the same name as an input permanent file. If you want to copy a permanent file to a temporary file of the same name, create the temporary file before calling COPY.

Using an index file is generally much faster than executing the same copy operations as separate COPY commands.

Copyright © 1996, Thinkage Ltd.