Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnewsk!ech From: ech@cbnewsk.ATT.COM (ned.horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: FSRead hangs on the serial driver Message-ID: <1811@cbnewsk.ATT.COM> Date: 11 Jan 90 03:38:10 GMT References: <4713@hydra.gatech.EDU> Organization: AT&T Bell Laboratories Lines: 12 In article <7770@unix.SRI.COM> gil@ginger.sri.com (Gil Porat) writes: >1) Why does the second FSRead hang? From article <4713@hydra.gatech.EDU>, by cc100aa@prism.gatech.EDU (Ray Spalding): > Because it will not return until it gets the exact number of characters > you asked it to read. A direct means of accomplishing what you want is to use SerGetBuf() to request the number of bytes available, then read the maximum of your buffer size and the available bytes. Wrapping that up in a little routine that behaves like the Unix read() on a serial port is left as an exercise... =Ned Horvath=