The COPY command is used to copy a single file, multiple files or a full diskette. COPY has 6 formats:
- COPY,filespec1[ ,TO] ,filespec2[ ,SPDN=dn3][,DPDN=dn4]
- COPY,$filespec1[,TO],filespec2[,SPDN=dn3][,DPDN=dn4]
- COPY,[:]dn1,filespec1[,TO],filespec2[,SPDN=dn3][,DPDN=dn4]
- COPY, [:]dn1 ,$filespec1 [,TO] ,filespec2[ ,SPDN=dn3][ ,DPDN=dn4]
- COPY, [:]dn1 [=tc1 ][ ,TO], [: 3dn2[=tc2] ,mm/dd/yy [ ,Y] [ ,N][ ,NDMW][,FMT][,NFMT][,SPDN=dn3 ][,DPDN=dn4][,SPW=password1] [,NDPW=password] [,DDND] [,ODN=name1] [,KDN3] [,KDD] [,NDN=name23 [,SN=name3] [,USD] [,BDU3] [,UBB]
- COPY, [:]dn1 [,TO],[:]dn2[=tc2] ,mm/dd/yy,CBF[ ,Y] [ ,N][ ,USR] [,/ext][,UPD][,ILF=filespec3][,XLF=filespec4][,CFW03 [ ,HDMW] [,FMT] [,NFMT] [,SPDN=dn3] [,DPDN=dn4] [,SPW=password1] [,0DPW=password2] [,NDPW=password3] [,DDND] [,ODN=name1 ] [ ,KDN] [ ,KBD] [ ,NDN=name2] [ ,SN=name3 ] [ ,USD] [ ,UBB3 [,DDSL=ln1][,DDGA=gcl]
The COPY command has been significantly changed in NEWDOS/80 version 2; all users, new and old, should carefully read this section.
COPY cannot be executed under MINI-DOS; however for simple single file copies, DOS library command MDCOPY is available.
dn1 and dn2 are drive numbers and may be equal. The colon preceding dn1 and / or dn2 is optional.
filespec1 is the source file's filespec. Filespec2 is the destination file's filespec.
filespec1 prefixed with $ means that either the source or the destination file or both are to be on drive 0 and are on diskette(s) that either (1) do not contain a NEWDOS/80 system identical to the one on drive 0 when COPY was initiated, (2) do not contain a NEWDOS/80 system, or (3) contain no system at all.
During processing for formats 2, 3, 4, 5 and 6, the system may ask for various diskette mounts; do what the prompts ask!!
- When prompted for the system diskette, mount the NEWDOS/80 diskette that was on drive 0 at the start of the COPY command execution.
- When prompted for the source diskette, mount the diskette containing file filespec1 (formats 1, 2, 3 and 4) or the data to be copied (formats 5 and 6).
- When prompted for the destination diskette, mount the diskette to contain file filespec2 (formats 1, 2, 3 and 4) or to receive the data being copied (formats 5 and 6).
SPDN=dn3 Source PDrive Number. SPDN=dn3 tells the system that for all source drive I/O, the system diskette's PDRIVE specifications (see DOS command PDRIVE, section 2.37) for drive dn3 are to be used instead of the source drive's normal PDRIVE specifications. dn3 is a value 0 to 9, referring to a drive number listed by the PDRIVE command.
DPDN=dn4 Destination PDrive Number. DPDN=dn4 tells the system that for all destination drive I/Os, the system diskette's PDRIVE specifications for drive dn4 are to be used instead of the destination drive's normal PDRIVE specifications. dn4 is a value 0 to 9 referring to a drive number listed by the PDRIVE command.
Note that use of SPDN and DPDN for a drive 0 single drive COPY (formats 4, 5 or 6) means that three different PDRIVE specifications (one for the system diskette, one for the source diskette and one for the destination diskette) will apply during the COPY even though only one drive is used.
Format 1 is the single file copy. It is used to copy the contents of file filespec1 to file filespec2. The diskette(s) involved in the COPY must already be mounted; the system gives no mount prompts. The contents of file filespec1 are not altered. The previous contents of file filespec2, if any, are lost. If the leading part of filespec2 equals that of filespec1, filespec2 may be shortened by leaving off the leading part, the remainder of filespec2 starting with / or . or :. For example:
COPY,USERFILE/DAT:0,TO,USERFILE/DAT: 1
can be shortened to:
COPY,USERFILE/DAT:0,TO,:1
Remember, the keyword TO is optional, and spaces may be used instead of commas. Thus the command could be written:
COPY USERFILE/DAT:0 :1
Format 2 is the same as format 1 except that the $ sign prefixed onto filespec1 indicates that a conflict exists with drive 0, the system drive, and DOS will prompt for the proper diskettes to be mounted on drive 0. If the source and destination drive numbers are both zero but the source and destination files are on separate diskettes, use format 4 instead of format 2.
Format 3 again is similar to format 1, except that the user has only 1 drive available for the copy and file filespec1 resides on a diskette different from that of file filespec2. Neither filespec can specify a drive number. DOS will prompt for the mount of the source and destination diskettes as they are needed. If drive 0 is specified, both the source and destination diskettes must contain a NEWDOS/80 system identical to the one mounted on drive 0 at the start of the COPY command; otherwise use format 4.
Format 4 performs similar to format 3 except that either file or both reside on diskettes with different NEWDOS/80 systems, non-NEWDOS/80 systems or no systems at all. DOS will prompt for the mount of the system, source and destination diskettes as they are needed. Format 4 should only be used when dn1 equals 0; otherwise you are wasting time with diskette swaps that are not needed.
Formats 2 and 4 allows suppliers of programs, whether free or purchased, to send their program products on diskettes that do not contain NEWDOS systems. Aside from the supplier's programs and/or data files, the diskette need only contain the directory and the BOOT/SYS file, both created on each diskette during formatting. Suppliers must not include a NEWDOS system on their diskettes unless they have made explicit arrangements with Apparat.
NEWDOS/80 does not have a diskette BACKUP program. Instead, either formats 5 or 6 is used. Format 5 is a full diskette sector by sector copy without concern for the number and type of files. Format 6 copies some or all of the source diskette's files onto the destination diskette. Of the two, for the same amount of data transmitted, format 5 is faster while format 6 allows greater variation between source and destination diskette types and tries to reassign files to contiguous space.
Format 5 is a full diskette copy. The default specifications for the two drives are the PDRIVE specifications currently being used by DOS. The drives must have the same number of sectors per track, granules per lump and sectors per granule (five is the current NEWDOS/80 standard); otherwise format 6 must be used. The destination diskette may have more tracks than the source; if so, the destination directory is adjusted to account for the extra free granules (not done if BDU option specified). Format 5 options are defined as follows:
=tc1 DOS is to use the value tcl as the source diskette's track count during the COPY rather than the source drive's default value.
=tc2 DOS is to use the value tc2 as the destination diskette's track count during the COPY rather than the destination drive's default value.
mm/dd/yy is the date to be placed in the destination diskette date field. The mm/dd/yy may be null, and if so the system date is used. The only time mm/dd/yy may be entirely left out of the format 5 COPY command is when the command has only the two drive number parameters (example: COPY 0 1 ). Otherwise mm/dd/yy must be the 3rd parameter even if it is null or to be overridden by either the KDD or the USD parameter. If the mm/dd/yy is null, this must be so indicated by separating commas (not spaces) (example: COPY 0 1,,FMT CBF ).
Y The user doesn't care what was previously on the destination diskette. Y is mutually exclusive with N, ODN, ODPW, DDND, KDN or KDD. Y is the default (for COPY) if none of its mutual exclusions are specified.
N At the start of the COPY or FORMAT the destination diskette must not contain recognizable data, i.e., should be in a bulk erase state. COPY will be terminated if the diskette is found to contain data. N is mutually exclusive with Y, ODN, ODPW, DDND, KDN or KDD.
NDMW No Diskette Mount Waits. DOS is to assume that all needed diskettes are already mounted on the specified drives. No mount prompts or error prompts are displayed. If an error occurs that otherwise would have caused a prompt, the copy will be terminated. If NDMW is specified and neither FMT nor NFMT are specified, FMT is assumed. NDMW is intended for use when COPY (or FORMAT) is invoked via DOS-CALL (i.e., from BASIC) and the calling program does not want operator interaction. Since NDMW causes the COPY or FORMAT to bypass error and disk mount queries, it is recommended that NDMW normally not be used when the operator is keying in the COPY (or FORMAT) command.
FMT Format. DOS formats the destination diskette before copying data. FMT is mutually exclusive with NFMT. If neither FMT or NFMT is specified and NDMW was not specified, the operator will be queried 'FORMAT DISKETTE? (Y OR N). If neither FMT or NFMT is specified and NDMW was specified, FMT is assumed.
NFMT No Format. DOS does not format the destination diskette before copying data. The user must assure that the destination diskette is already formatted correctly. NFMT is mutually exclusive with FMT.
SPW=password1 Source Password. If passwords are enabled (system option AA = Y) and system option AR = N, then COPY requires a source diskette master password match. If password1 does not match the source diskette's password, the copy function will be terminated.
NDPW=password3 New Destination Password. Password3 must conform to rules for passwords and is assigned as the destination diskette's new password. NDPW is mutually exclusive with BDU.
DDND Display Destination old Name and Date. The destination diskette's old name and date are prompted to the display, allowing the operator to decide whether or not to proceed with the copy. DDND is mutually exclusive with Y, N, and NDMW.
ODN=name1 Old Destination Name. If the destination diskette's old name is not equal to name1 , then the system prompts, allowing the operator to decide whether to proceed with the copy. ODN is mutually exclusive with Y, N and NDMW.
KDN Keep Destination diskette Name. The destination diskette keeps its old name rather than receive the source diskette's name. KDN is mutually exclusive with Y, N, BDU and NDN.
KDD Keep Destination diskette Date. The destination diskette keeps its old date rather than receive the mm/dd/yy parameter from the COPY command. KDD is mutually exclusive with Y, N, BDU and USD.
NDN=name2 New Destination Name. The destination diskette takes name2 as its name, rather than receive the source diskette's name. Name2 must conform to the specification for diskette names. NDN is mutually exclusive with BDU and KDN.
USD Use Source Date. The destination diskette uses as its date the source diskette's date, rather than receive the mm/dd/yy parameter from the COPY command. USD is mutually exclusive with KDD and BDU.
SN=name3 Source diskette Name. If the source diskette's name is not equal to name3, a prompt is issued, allowing the operator to decide whether or not to proceed with the copy.
BDU Bypass destination Directory Update. Aside for simply copying the source sectors onto the destination diskette, the format 5 COPY also updates the boot and PDRIVE data in the destination file BOOT/SYS and, as necessary, the name, date, password and extra granule information into file DIR/SYS. There are times, however, when this file updating is not wanted, and by specifying option BDU these updates are bypassed. BDU is useful when the source diskette has a bad directory, has a non-standard directory (such as a TRSDOS Model III directory) or has no directory at all or when the user wants a full diskette copy with no alterations. BDU is mutually exclusive with KDN, NDN, NDPW and USD.
UBB Use Big Buffer In NEWDOS/21 and NEWDOS/80 version 1, COPY was restricted to using main memory below 7000H unless it was a two diskette, single drive COPY, in which case all of memory to HIMEM was used. If a user wanted to force the usage of all memory to HIMEM, the UBB parameter had to be specified. However, in NEWDOS/80 version 2, all of main memory to HIMEM is used unless the COPY was invoked under DOS-CALL (i.e., from BASIC), in which case only main memory below 7000H is used. Thus, in NEWDOS/80 version 2, UBB is a useless parameter left in existence only for upward compatibility from Version 1.
Format 6 is the multiple file COPY and is distinguished from format 5 by the inclusion of the CBF (Copy By File) option. Though format 5 is the faster way to backup a diskette, format 6 offers more flexibility, allowing files to be copied between diskettes and drives of widely varying characteristics. The choice of files to be copied can be limited by the combined effect of options USR, /ext, UPD, ILF, XLF and CFWO; if one or more criteria are specified, only those files satisfying all the criteria are copied. Format 5's options, except BDU, are used in format 6 as well as the following additional options.
If NFMT is specified, then none of Y, N, KDN, KDD, NDN, BDU, USD, NDPW, DDSL, DDGA or tc2 may be specified, ODPW may be required, and system files are not copied unless already existent in the destination file directory.
If NFMT is not specified, then the destination file is formatted as if the command was FORMAT, including establishing BOOT/SYS and DIR/SYS. Then, before any files are copied, all files to be copied are entered into the destination diskette's directory. This is necessary as system files must occupy the same directory FPDEs in order for DOS to work at all.
CBF Copy By File CBF, required for and used only in format 6, indicates the copy will be done by files rather than in straight sequential order of diskette sectors.
USR copy user files. Only user files are copied; system and invisible files are excluded.
/ext copy files having name extension ext. Only files with name extension ext are copied. ext is a 0 to 3 character name extension. Examples of this parameter are /CMD, /, /BAS, /X.
UPD copy updated files Only files that have the updated flag on in the source diskette directory are copied. This flag is turned on by the standard DOS sector write routine to indicate that at least one sector has been written or re-written to this file since the last time the updated flag was cleared. This flag is turned off by specific request via the PROT or ATTRIB commands and is NOT turned off by COPY. Since the standard DOS sector write routine is used to write the file's sectors to the destination diskette, the updated flag is turned on for the copied destination files.
ILF=filespec3 Include List File Filespec3 specifies a file containing a list of files to be copied. If a file is not in the list, it is not copied. It is not an error if an included file is not on the source diskette. Within the list, each file to copied is specified by its name/ext followed by a EOL char ( 0DH). If a specification begins with a semicolon, it is bypassed as a comment. Each specification, except comment, is limited to a maximum of 13 characters, including the EOL. On reading, the file's bytes are modulated into the ASCII range 0 to 127. The file can be made using SCRIPSIT, but the user must assure that no characters other than null ( 00H) follow the last EOL character; SCRIPSIT tends to leave extraneous characters so a delete-to-end-of-text should be done. ILF is mutually exclusive with XLF.
XLF=filespec4 Exclusion List File. The file filespec4 is the same structure as specified for ILF above and specifies the files to be excluded from the COPY. It is not an error if an excluded file is not on the source diskette. XLF is mutually exclusive with ILF.
CFWO Check File With Operator. For the qualifying files, DOS asks the operator, one file at a time, if the file is to be copied to the destination diskette. Reply Y if the file is to be copied, reply N if not to be copied, reply R if to restart entire CFWO query sequence, or reply Q if no more files to be copied. No files are copied until the querying is completed.
ODPW=password2 Old Destination diskette Password. If NFMT is specified, if passwords are enabled and if system option AR = N, then copy requires a destination diskette password match. If password2 does not match the destination diskette's password, the copy is terminated.
DDSL=ln1 Destination diskette Directory Starting Lump. Formatting will start the directory on the 1st sector of lump lnl if DDSL is specified; otherwise the default starting lump number for the drive (see PDRIVE command) will be used. DDSL is mutually exclusive with NFMT.
DDGA=gc1 Destination diskette Directory Granule Allocation. Formatting will allocate gcl (value 2-6) granules to the directory if DDGA is specified; otherwise it will assign the default # of granules for that drive (see PDRIVE command). DDGA is mutually exclusive with NFMT.
If during a format 6 COPY, the destination diskette has insufficient space to contain a file, "DISKETTE FULL = name/ext" is displayed and the destination file's EOF is set to 0. Though EOF is set to 0, any space the file may have allocated to it is not deallocated.
A single drive format 5 or 6 COPY cannot be executed under DOS-CALL (i.e., from BASIC) since COPY under DOS-CALL restricts itself to main memory below 7000H and this would necessitate too many diskette swaps.
During a COPY or FORMAT where NDMW was not specified, pressing right arrow at any time will cause the function to pause, awaiting ENTER to continue or up-arrow to cancel. Pressing up-arrow at any time will terminate the function; however, be careful as the state of the destination diskette will be unknown, especially if the cancel comes during the actual formatting.
The COPY command and standard 40 track, double density, single sided, 5 inch TRSDOS Model III diskettes may be used to transfer TRSDOS Model III diskette files into or out of the NEWDOS/80 system. There are a number of restrictions to this operation.
NEWDOS/80 cannot be used to format a TRSDOS Model III diskette; however, once the user has a formatted empty TRSDOS Model III diskette, he/she may duplicate it repeatedly under NEWDOS/80 using format 5 COPY with the NFMT and BDU options, thus obtaining a stock of formatted, empty TRSDOS Model III diskettes.
The user must assure that where the source and/or destination is a TRSDOS Model III diskette the proper PDRIVE specs are invoked, either implicitly or directly by the SPDN and/or DPDN parameter (see PDRIVE command example 3, section 2.37 for the exact PDRIVE specification).
A file need not previously exist on a TRSDOS Model III diskette in order for it to be copied. NEWDOS/80 will allocate the proper directory entry and diskette space.
Any of COPY formats 1, 2, 3, 4 or 6 may be used to copy files to or from TRSDOS Model III diskettes. Remember, FMT must not be specified. If format 6 is used and one of the source or destination is a TRSDOS Model III diskette, then files marked as SYSTEM files (FPDE 1st byte, bit 6=1) are NOT copied.
Files copied between NEWDOS/80 and TRSDOS Model III are always readable though not necessarily usable on the receiving system.
Examples of COPY:
- COPY XXX:1 YYY:1
In this format 1 COPY, file XXX on the diskette already mounted on drive one is copied as file YYY on that same diskette.
- COPY,AAA,BBB:2
In this format 1 COPY, the currently mounted diskettes are searched for the file AAA. If found, it is copied as file BBB to the diskette already mounted in drive 2.
- COPY SUPERZAP/CMD:0 :3
In this format l COPY, the file named SUPERZAP/CMD is copied from diskette already mounted in drive 0 to the diskette already mounted in drive 3. Since the file name and name extension are the same for both files, they were dropped from the second filespec.
- COPY XXX:1 2 SPDN=9
In this format 1 COPY, SPDN=9 causes, for the duration of the COPY only, all source file I/O to assume that drive 1 has the characteristics specified for drive 9 in the PDRIVE specifications. If we assume that the PDRIVE drive 9 specifications were those for a Model III TRSDOS diskette (see PDRIVE example 3, section 2.37), this COPY will copy file XXX from the TRSDOS Model III diskette already mounted on drive 1 to the NEWDOS/80 diskette already mounted on drive 2.
- COPY $XXX:1,YYY:0
In this format 2 COPY, the destination diskette to contain file YYY is not the same diskette as was mounted on drive 0 when the COPY command was initiated. DOS will ask for the mount of the destination and the system diskettes as it needs them.
- COPY,$XXX:0 YYY:1
In this format 2 COPY, the source diskette containing file XXX is not the same diskette as was mounted on drive 0 when the COPY command was initiated. DOS will ask for the mount of the source and system diskettes as it needs them.
- COPY 1 XXX YYY/DAT
In this format 3 COPY, the diskette containing file XXX is not the same diskette as the one to contain file YYY/DAT yet both the source and destination diskettes are to use drive 1. DOS will ask for the mount of the source and destination diskettes as it needs them. Note that, as required for format 3 and 4, neither filespec contains a drive number.
- COPY 0 XXX/DAT /DAT
In this format 3 COPY, file XXX/DAT on one diskette is to be copied as file XXX/DAT on another. Both diskettes are to be mounted on drive 0, and DOS will ask for them as needed. Since drive 0 is used and this is format 3 rather than format 4, both the source and destination diskettes must contain NEWDOS/80 systems identical to that mounted on drive 0 when the COPY command was initiated.
- COPY 0 $XXX/DAT /DAT
This format 4 COPY accomplishes essentially the same thing as the previous example. The difference is that DOS assumes that neither the source nor the destination diskette contains the proper NEWDOS/80 system; so DOS will ask for the mount of the system, source and destination diskettes as it needs them.
- COPY 0 $XXX XXX SPDN=9
This format 4 COPY accomplishes the same thing as in example 4 above excepting that only drive 0 is used. For the duration of this COPY, drive 0 uses two sets of PDRIVE specifications. The standard drive 0 specifications are used for the system and destination diskette I/Os, and the system diskette's PDRIVE's drive 9 specifications are used for the source diskette I/Os. Note, in this example, the second filespec was not foreshortened as there was nothing to foreshorten.
- COPY 0 1 06/01/80 FMT
This format 5 COPY is an example of one of the simplest and most commonly used forms of the full diskette COPY. This COPY copies one diskette to another using drive 0 as the source drive and drive 1 as the destination drive. Default track counts for the associated drives are used as diskette track counts. Both drives, other than possibly having different track counts (destination must be greater than or equal to source), have the same characteristics. The operator will be prompted for diskette mounts and error choices, if errors occur. Default parameter Y is in effect, indicating the operator does not care if the destination diskette previously contained data or not. The destination diskette will be formatted before the entire source diskette is copied to it, and it will receive the source diskette's name and password. Its date will be set to 06/01/80. If the destination diskette is to have more tracks than the source, they will be formatted and properly accounted for in the directory such that the destination diskette will be ready for use.
- COPY 0 1,,NFMT
This format 4 COPY is an example of another form of the simplest and most common full diskette copy. The only difference between this example and the one above is (1) the destination diskette is assumed already formatted, and (2) the current system date will become the destination diskette's date.
- COPY, 0,0,06/01/80, NFMT, USD, KDN,ODN=WATCHDOG,SN=GOODDATA
This format 5 COPY is somewhat the same as the previous example except (1) this is a single drive, two diskette copy, (2) a prompt will be given if the source diskette does not have the name specified, (3) a prompt will be given if the destination diskette does not have the name specified, (4) the destination diskette will retain its old name, (5) it will receive its date from the source diskette. Being a single drive, two diskette copy, more mount prompts will be necessary than for a two drive COPY. Also, because of the large number of diskette mounts that would be involved, this single drive COPY cannot be executed via DOS-CALL (i.e., from BASIC).
- COPY 0,1,,FMT,CBF
This format 6 COPY is an example of one of the simplest and most commonly used forms of multiple file COPY. The destination diskette (to be mounted on drive 1) is to be formatted, and it receives its name and password from the source diskette (to be mounted on drive 0) and its date from the system date. Next, all of the source diskette's files, excepting BOOT/SYS and DIR/SYS, are copied to the destination diskette.
- COPY 0,1,,NFMT,CBF
This format 6 COPY is an example of another of the simplest and mostly commonly used forms of multiple file COPY. The differences between this and example 14 are (1) the destination diskette is not to be formatted, (2) its name, password and date are not changed, and (3) any source diskette system files (other than BOOT and DIR) that did not already exist on the destination diskette are not copied.
- COPY 0 1,,NFMT,CBF,USR
This format 6 COPY is similar to the previous example except that system and invisible files are not copied.
- COPY,0,1,,NFMT,CBF,USR,UPD
This format 6 COPY is similar to the previous example except that the only source files copied are those marked as updated as well as not being either a system or an invisible file. In this manner, only the files changed since the last backup are backed up now. Remember, COPY does not clear the updated flags on the source diskette; use DOS commands PROT or ATTRIB to do this.
- COPY,2,3=60,06/01/80,FMT,NDMW,CBF,DDSL=29,DDGA=4
During this format 6 COPY no diskette mount prompts or error choices are to be displayed; the system is to assume the diskettes are already properly mounted. The destination diskette is to be formatted with 60 tracks. The directory will start on lump 29, and will be allocated 4 granules. All source diskette files, except BOOT/SYS and DIR/SYS, will be copied to the destination diskette.
- COPY 2 3 06/01/80,CBF,CFWO,NFMT
For this format 6 COPY, the destination diskette is assumed previously properly formatted and may contain existing files. For each source diskette file, excluding BOOT/SYS and DIR/SYS, the operator will be asked if the file is to be copied to the destination diskette. When all queries are done, the selected files are copied, excepting that system files that did not previously exist on the destination diskette are not copied. If the file already existed on the destination diskette, the file's old data on the destination diskette is lost.