Path: utzoo!attcan!uunet!snorkelwacker!apple!goofy.apple.com!chesley From: chesley@goofy.apple.com (Harry Chesley) Newsgroups: comp.sys.mac.programmer Subject: Re: FSRead hangs on the serial driver Message-ID: <6157@internal.Apple.COM> Date: 12 Jan 90 18:47:20 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 28 References:<7770@unix.SRI.COM> <4713@hydra.gatech.EDU <6113@internal.Apple.COM> <3915@atr-la.atr.co.jp> <3916@atr-la.atr.co.jp> In article <3916@atr-la.atr.co.jp> alain@atr-la.atr.co.jp (Alain de Cheveigne) writes: > I suppose that, if the driver is closed on exit, the buffer gets reset > to default the next time the driver is opened. But this wouldn't be > the case if the driver was left open. By the way, no one answered a > previous question of mine: is it ok to leave the driver open on exit? I'm not sure what the definitive answer is these days. I started working with the serial driver in the 512K days, when there were different ROM and RAM-based drivers. I always used the ROM drivers, just to keep things as simple as possible. Quoting from Inside Mac II-248: "You shouldn't ever close the ROM Serial Driver with a Device Manager Close call." It goes on to say that you SHOULD close the RAM drivers. A much later tech note points out that if you're running on a 128K ROM or later machine, you should just call OpenDriver, rather than RAMSDOpen, as from that point on the "RAM" driver is in ROM, and that'll be more compatible with future releases. So, these days, and assuming you don't expect your program to run on a 512K unenhanced or a 128K Mac, you should use OpenDriver and CloseDriver. The close will deallocate the buffer properly. (I haven't actually tried that, but that's what the docs say...) Or, forget the serial port driver and use the Comm Toolbox. That's what I'm about to do.