Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ucdavis!pollux!vmrad From: vmrad@pollux (Bernard Littau) Newsgroups: comp.sys.mac.programmer Subject: Re: For GURU'S Only Message-ID: <6767@ucdavis.ucdavis.edu> Date: 16 Feb 90 21:28:52 GMT References: <4073@ccncsu.ColoState.EDU> <34253@ucbvax.BERKELEY.EDU> <6711@ucdavis.ucdavis.edu> <1533@smurf.ira.uka.de> <6747@ucdavis.ucdavis.edu> <1546@smurf.ira.uka.de> Sender: uucp@ucdavis.ucdavis.edu Reply-To: vmrad@pollux (Bernard Littau) Organization: University of California, Davis Lines: 50 I say: >< >I don't think you need a disk write buffer if you write to the hard disk. >< >What I did was to call PBRead(serial port, (16 kByte or end of picture)) >< >asynchronously, call WaitNextEvent with a reasonable timeout (based on the >< >serial speed, how much you want to read, and how much is already there), and >< >call PBWrite to your disk file if that call completes. >< >Allocate a nice big serial buffer (maybe 48k)... >< >< As I read your reply, you are doing: >< SerSetBuf( a 48k buffer) >< PBRead(serial port, serial port buffer) >< PBWrite(to disk, serial port buffer) Matias says: >Replace this with: >PBRead (serial port, private 16kB buffer) >PBWrite (Disk, same buffer) >After I say SerSetBuf(), said buffer belongs to the serial driver until >the next SerSetBuf. I do not assume anything about what the serial driver does >with that buffer. >I never understood why anyone would be reading from the serial buffer to the >serial buffer, much less assume that I implied this... >So, I don't see what could possibly go wrong with the above method. You are completely correct. Nothing would go wrong with this above method. I was let to assume you were reading from serial buffer to serial buffer by the statement: "I don't think you need a disk write buffer..." and in that I assumed: SerSetBuf( a 48k buffer) PBRead(serial port, serial port buffer) implied one single 48k serial port buffer used in both calls. Bad assumption, apparently. Sorry. In my nomenclature, the serial buffer is used by SetSerBuf, and the disk write buffer is used by PBRead and PBWrite. So we all don't think alike. Bitte enshuldigen Sie mir! Ich solte mehr denken, und winiger ouf dem computer schreiben. Shade das mein Deutsche ist nicht so gut wie Ihren English. My Respect, Bernard Littau VM Radiological Sciences Telephone: (916) 752-4014 School of Veterinary Medicine Internet: vmrad@ucdavis.edu University of California BITNET: vmrad@ucdavis Davis, CA 95616 UUCP: ucbvax!ucdavis!vmrad