From: John Feezell Date: 2004-07-21T21:50:06+09:00 Subject: Re: sysread and buffered I/O On Wed, 21 Jul 2004 18:56:01 +0900, 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.) Here are some other possible names that seems to fit with readchar, readline, and readlines and yet catch the idea of "readpartial." readportion readparcel readbundle readatmost Personally, "readatmost" would fit closes in my mind to the above description.