Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!sci.ccny.cuny.edu!phri!cmcl2!esquire!yost From: yost@esquire.UUCP (David A. Yost) Newsgroups: comp.lang.icon Subject: reads() considered weak Message-ID: <1786@esquire.UUCP> Date: 14 Feb 90 22:00:14 GMT Organization: DP&W, New York, NY Lines: 30 I'm writing a filter that has to work in real time with binary input, so I am calling reads(). If I call reads(), everything works, but extremely slowly because reads() defaults to reading one character at a time. So I call reads() with a larger number as the count argument. Problem is, reads() insists on waiting until all of those characters have come in before it will return. This is nice behavior for some situations but horrible for others, in particular my situation, where I need reads() to return with whatever it got. This leads me to suggest that reads() should have an additional argument, perhaps as in this spec: reads (f,i,j) Values for j are: 0 (the default) will not return until it gets all i characters or until end of file. 1 returns with a partial count rather than block. 2 returns with a 0 or partial count rather than block. Has anyone done anything like this? I'm really just asking for access to more of the normal functionality of the underlying UNIX system call. --dave yost yost@dpw.com or uunet!esquire!yost