Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!neighbor From: neighbor@csd4.milw.wisc.edu (Jeffrey Alan Ding) Newsgroups: comp.sys.apple Subject: Re: support of ProDOS disk swapping Message-ID: <1423@csd4.milw.wisc.edu> Date: 4 Mar 89 03:19:00 GMT References: <8903022345.aa13273@SMOKE.BRL.MIL> Sender: news@csd4.milw.wisc.edu Reply-To: neighbor@csd4.milw.wisc.edu (Jeffrey Alan Ding) Organization: University of Wisconsin-Milwaukee Lines: 44 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!!? > >A file must be OPENed before it can be read from or written to. >ProDOS does _not_ expect a disk to be removed while their are open >files on it, and it will _not_ look in that drive for other volumes. >So a program that needs to support disk swapping needs to CLOSE all >open files after remembering where it was in each one (by doing >GET_MARKs, perhaps), and later it needs to re-open the files and >SET_MARK back to where it left off. Not a major pain, but not >completely trivial, either. 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. >>Andy >>art100@psuvm.bitnet / a1t@ecl.psu.edu > > --David A. Lyons bitnet: awcttypa@uiamvs neighbor@csd4.milw.wisc.edu