From: Robert Klemme Date: 2009-03-18T03:37:33+09:00 Subject: Re: does IO.read block? On 16.03.2009 22:12, Albert Schlef wrote: > Robert Klemme wrote: >> On 15.03.2009 23:02, Michael Malone wrote: >>> Or does read_end.read block until it finds EOF? >> Yes, that's what it does: >> http://www.ruby-doc.org/core/classes/IO.html#M002295 > > The docs shouldn't be read as a Bible. The docs may not be very precise. > If IO#read is similar to C's read(), then it also returns when it had > read all the available bytes. See "man 2 read". In this particular case the docs are correct to my knowledge. In other words IO#read *will* block until the full stream is read (or an error condition occurs of course). Cheers robert