0010 ^ma7 73 ^ju APPNDCAS -- by Michael Markov 0020 ^sk1 APPNDCAS is an improved additive copy program. It allows you to copy files from 0021 one mass storage device 0029 and add them to a "master" mass storage volume (disc or tape), 0030 without overwriting any files that may already exist on the 0031 "master". As written, this program uses two drives to do the job. It should be easy to 0032 modify the program for single drive operation -- all you need is suitable operator 0033 instructions to exchange the master & source mediums, as required. However, this would 0034 create the opportunity for dangerous operator errors. 0040 ^sk1 There are several important differences between APPNDCAS and existing additive 0050 copy programs like ACOPY, FLCOPY and DDCOPY: 0061 ^sk0 -- The only LEX file you must have is EDLEX (Text Editor or FORTH / Assembler ROMs). 0062 The keywords REV$ (STRINGLX) and IMAGE$ (FMTLEX in the Data Acquisition ROM) 0063 can be used to some advantage, if available. 0067 ^sk0 -- There are no restrictions on allowable file names or file types. 0070 ^sk0 -- Files with names that match the name of files on the destination medium are copied, 0080 and the name is automatically changed so that each file has a unique name. 0090 ^sk0 -- the files from the source medium are transfered to the destination medium as a 0100 block, as opposed to transfering the files one at a time. 0110 This speeds-up the transfer process and reduces power consumption dramatically. 0120 ^sk1 Typical applications include making archival backup copies of important files, and 0130 combining the contents of several tapes or discs onto a master to create 0140 a master swaptape or disc at conferences and Chapter meetings. 0141 ^sk1 The high efficiency of the APPNDCAS copy process can also help you optimize 0142 your use of available mass storage capacity, by 0143 effectively "resizing" the directory, without causing any significant 0144 medium wear. See "User Instructions" below. 0150 ^sk1 Finally, APPNDCAS carefully checks both the source and destination directories, and 0151 limits the scope of the data transfer to the reflect the number of unused directory 0152 on the destination medium or the remaining unused storage capacity, 0153 whichever is most restrictive. This means that you can safely (and very efficiently) 0160 copy the contents of 3.5" discs onto either 5.25" discs or cassettes. 0170 ^sk1 BACKGROUND: There are several additive copy programs in use today, to include ACOPY 0171 (by Roland White, Atlanta Swaptape) 0180 FLCOPY (Chris Erickson & Brian Walsh, WCES '86 swapdisc) & DDCOPY. 0190 The original ACOPY routine used CAT$(I,":devspecifier") to 0200 get the name of the Ith file on the source medium. Then, CAT "filename:device" was used 0210 to determine whether such a file already existed on the destination medium. Finally, 0220 COPY~"filename:dev1" to ":dev2" would actually transfer the file. Since the COPY keyword 0230 carries out a directory search on both the source and destination medium, this process 0240 required four directory searches per file transfered. 0250 This process was slow and consumed a lot of power. Its main advantage 0260 was that the copy process required very little user intervention. 0270 ^sk1 FLCOPY has a number of convenient features that allow you to select the files that 0280 are actually transfered. It is an excellent program for transfering a few files at a time. 0289 The copy process 0290 was made somewhat more efficient by eliminating the test for a file of the same 0300 name on the destination medium. This test was not needed, because the copy is 0310 automatically aborted by the HP-71 operating system with a "file exists" error. 0320 This reduced the number of directory searches from four to three, thus improving copy 0330 efficiency by almost 25%. 0340 ^sk1 DDCOPY eliminated yet one more directory search by accessing the source directory 0350 once, and by storing all the filenames on the source medium in a TEXT file. This brought 0360 copy efficiency to an optimum, for programs that rely on the COPY keyword. 0370 ^sk1 It should be noted that ACOPY, FLCOPY and DDCOPY all packed the files transfered onto 0380 the destination medium, eliminating the space reserved by files purged from the source 0390 medium, if any. 0400 ^sk1 APPNDCAS eliminate repetitive directory searches altogether. Instead, it reads the 0410 two directory spaces once, saving pertinent data in two TEXT files. Selected file & 0420 directory pointers are saved & adjusted under program control. Then, the adjusted 0430 directory entries are saved in the destination directory. 0440 Finally, the file data itself gets transfered. 0450 ^sk1 The copy procedure used by APPNDCAS is very similar to the normal COPY process, the 0460 main difference being that many files are transfered at once, instead of only one. 0470 ^sk1 In order to compare the efficiency of APPNDCAS and, for example, DDCOPY, consider 0480 the sequence of events that happens when you are copying 20 files from a tape to a disc 0490 that already has 200 entries. 0500 The first COPY instruction must process 1 directory entry from the source medium, and 200 0510 from the destination medium. Each following COPY instruction must process 0520 two more entries, for a total of 4380 entries, or 140,160 bytes. 0521 If we assume an average file length of 2000 bytes, the combine length of the files 0522 is only 40000 bytes.... 0529 In comparison, APPNDCAS reads the 220 entries (7040 bytes) only once. 0531 ^sk1 It should be noted that the actual copy process is a bit more complicated. 0532 Status checks and other tasks must be carried for each COPY operation. As a result, 0540 APPNDCAS can be even more efficient than indicated above. 0560 ^sk1 TECHNICAL DETAILS: See comments in program listing. 0570 ^sk0 The copy process used by APPNDCAS is straightforward in structure, but intricate in 0580 detail. The present code avoids a variety of problems, many of which are not mentioned. 0590 Minor program changes "to save bytes" could have disastrous results under certain 0600 conditions. YOU HAVE BEEN WARNED! 0610 ^sk1 USER INSTRUCTIONS: First, set-up the loop with two or more drives, 0611 and load the source and destination medium in the drives. The destination medium must 0612 be an initialized medium. Keep in mind that APPNDCAS will only transfer files if a) there 0613 is room for additional entries in the destination directory AND b) there is room to store 0614 the files themselves. THIS VERSION DOES NOT GIVE ANY 0615 WARNINGS IF THE TRANSFER IS LIMITED TO ONLY 0616 PART OF THE DESIRED TRANSFER! 0620 ^sk0 -- Additive Copy: To add the contents of a tape 0630 to a disc,