Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!blake!phaedrus From: phaedrus@blake.acs.washington.edu (the Wanderer) Newsgroups: comp.sys.apple Subject: Re: support of ProDOS disk swapping Message-ID: <1052@blake.acs.washington.edu> Date: 4 Mar 89 04:20:45 GMT References: <8903022345.aa13273@SMOKE.BRL.MIL> <1423@csd4.milw.wisc.edu> Reply-To: phaedrus@blake.acs.washington.edu (the Wanderer) Organization: University of Washington, Seattle Lines: 65 In article <1423@csd4.milw.wisc.edu> neighbor@csd4.milw.wisc.edu (Jeffrey Alan Ding) writes: >In article <8903022345.aa13273@SMOKE.BRL.MIL> AWCTTYPA@UIAMVS.BITNET ("David A. Lyons") writes: >>>From: "Andy Tefft (814) 862-6728" >>>Subject: single-drive programs >> >>>[...] How hard is it to make a program say "volume not found. please >>>insert correct disk or press to exit" and wait for your answer, >>>INSTEAD of just saying "Volume not found" and ending!!? >> >>[description of technique involving GET_MARK and CLOSE followed by >> OPEN and GET_MARK] > >Not necessary. All one has to do is an ONLINE call to make sure the correct >volume is in the drive. The requirements are that you know the volumes of >both disks, the SOURCE disk and the TARGET disk. > >Get the volume of the SOURCE disk, OPEN input file, READ from that file and >perform any operations on the data. Then do an ONLINE call, prompt user >to insert TARGET disk if not online, OPEN output file and WRITE out data. > >Then do another ONLINE call, prompt user to insert SOURCE disk if not >online, READ from input file and perform any operations on the data. >Do an ONLINE call, prompt user to insert TARGET disk...... and so forth. > >This routine can be built into the same code as the non disk swapping >code. Do an online before you open any files to make sure the SOURCE >disk and TARGET disk are online. If they are, then no swapping will take >place and the ONLINE calls are unecessary. If both volumes are not online, >then you make the ONLINE calls each time you move between reading and writting. > >As for the comment on not enough memory to support swapping - nonsense! >Adding this code would take less than 1/4K of memory. > I'm not sure that I follow the logic of this. The ONLINE call at the very beginning makes good sense; and, as you say, if both volumes are on-line, nothing further need be done. If they are not, and unless the machine spontaneously sprouts another drive during the process, it seems unnecessary to do an ONLINE between each read and write; you just got done reading from, say, the source disk, so you *know* that the destination disk isn't going to be there. In fact, in this situation, the sensible time to do the ONLINE call is *after* you have prompted the user to change disks and the user has pressed a key to continue--so that you know that the user has put the proper disk in the drive. Also, in this situation, the program should *definitely* remember its position in the file and close the file when it is not actually being read from or written to, as David Lyons described. Any time a user is changing disks during a process, the number of things that can go wrong boggles the mind... and keeping the file on the removed disk closed minimizes the risk that such a mistake will trash the directory of the destination disk or do something equally nasty. Oh, yes; when using an ONLINE call for this sort of purpose, always use the form of the call that checks a specific slot and drive, not the form that scans all slots and drives in the system. The most annoying form of program in existence has got to be a certain utility I have (which shall remain nameless), which copies files in exactly the manner described, and constantly... makes...that annoying...grinding...noise...on every... 5.25" floppy... drive in... the system... while it satisfies... itself... that neither... of the disks... you're using... have moved... lately. (I'm sure that someone out there will recognize the program... :) ) -- Mark VanWinkle Computer Science Hopeful, University of Washington INTERNET: phaedrus@blake.acs.washington.edu DISCLAIMER: Whatever it was, I was nowhere near it at the time.