The general syntax of the COPY command has three forms:
a. COPY,<file spec>,<file spec>
b. COPY,<file spec>,<drive>
c. COPY,<drive>,<drive>[,<match list>]
where <match list> is the same as that described in the CAT command and all the rules apply to matching names and extensions. When files are copied, if the destination disk has a file with the same name as the file being copied, the file name and the message "FILE EXISTS - DELETE ORIGINAL?" will be displayed on the console. Typing "Y" will cause the file on the destination disk to be deleted and the file on the source disk will be copied to the destination disk. Typing "N" will direct FLEX not to copy the file in question.
The first type of COPY allows copying of a single file into another. The output file may be on a different drive, but if it is on the same drive then the file names must be different. It is always necessary to specify the input file's extension, but the output file's extension will default to that of the input file if none is specifed. Example:
This command would cause the file TEST.TXT on drive 0 to be copied to a file named TEST25.TXT on drive 1. Note that the destination file's extension defaulted to TXT, the same as the input file.
The second type of COPY allows copying a file from one drive to another with the file name unchanged. Example:
Here the file named LIST.CMD on drive 0 would be copied to drive 1. It is again necessary to specify the file's extension in the file specification. This form of the command is more convenient than the first if the copied file is to have the same name.
The final form of the COPY command is the most versatile and the most powerful. With this form, it is possible to copy all the files on one drive to another drive, or only those files which match one of the patterns in the match list. Examples:
The first example would copy all the files on drive 0 to drive 1. The second example would copy all CMD and SYS files on drive 1 to drive 0. The third example would copy from drive 0 to drive 1 all files beginning with the letter A or the letter B, or beginning with the letters CA and with an extension beginning with the letter T. This form of the COPY command is the most versatile because it allows a set of files to be extracted from a disk. The file name is always preserved with this form. During execution, the name of each file copied is displayed on the console along with the drive to which it is copied.
The match list is processed as follows: for each partial file specification in the list, all the entries in the catalog of the source disk are tested and those that match are copied. Then the whole catalog is scanned again for matches to the next specification in the list. Thus all the files which match a given specification will be grouped together in the catalog of the output disk. If a file matches more than one specification in the list, then COPY will try to copy it as many times as it matches. Example:
would copy the file ABC.TXT twice. The second time would generate the "FILE EXISTS - DELETE ORIGINAL?" prompt.
Two versions of copy are supplied with GIMIX FLEX 4.x. Except for the manner in which the file creation date is handled they are functionally identical. Use the RENAME utility to change the name of the preferred version to COPY.CMD.
COPY-TSC creates its output file through the normal FMS file creation function. Therefore the creation date of the output file is the current system date. This is the standard version of COPY normally supplied with FLEX.
COPY-GMX has been modified by GIMIX so that the creation date of the output file will be the same as that of the input file. For all files except random-access files, this date is the last date on which the file's contents were altered, and is often very useful to know. This version of COPY allows all copies of a file with the same contents to have the same date.