From: "Ara.T.Howard" Date: 2004-07-21T22:02:12+09:00 Subject: Re: sysread and buffered I/O On Wed, 21 Jul 2004, Tanaka Akira wrote: > In article <189-1205065002.20040721185353@soyabean.com.au>, > Gavin Sinclair writes: > >> Tanaka, can you please give a brief description of the method (assume >> I know nothing about advanced I/O), and I'll suggest a name. Of >> course, other people will too. > > [ruby-dev:23247] contains a patch including RDoc comment in English. > > /* > * call-seq: > * ios.readpartial(integer [, buffer]) => string, buffer, or nil > * > * Reads at most integer bytes from the I/O stream but > * it blocks only if ios has no data immediately available. > * If the optional buffer argument is present, > * it must reference a String, which will receive the data. > * It raises EOFError on end of file. > * > * STDIN.readpartial(4096) #=> "Data immediately available" > */ > > (The behavior on EOF is modified.) why not IO#receive as in STDIN.receive(4096) #=> "we are receiving data as it becomes available" -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================