From: Yohanes Santoso Date: 2004-07-23T21:44:37+09:00 Subject: Re: sysread and buffered I/O Tanaka Akira writes: > /* > * 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" > */ How about: STDIN.readposixly(4096) or STDIN.posix_read(4096) Why posix? The behaviour described above is similar to the behaviour of posix's read function. posix's read function does a short read[1] if there is not enough data available to satisfy the request, but perform a full read if there is enough data. it will also block until there is some data to be read. I am actually leaning towards readposixly than posix_read. I read 'readposixly' as: do a read in a manner described in the posix standard. Meanwhile, 'posix_read' could be misinterpreted to be: read using a posix function, which people on non-posix systems might interpret as not being available on their systems. Thanks, YS. Footnotes: [1] reading less than requested. "short read" is a well-established phrase. google for: ' "short read" posix '