From: Yukihiro Matsumoto Date: 2005-06-10T17:44:24+09:00 Subject: Re: IO#read Hi, In message "Re: IO#read" on Fri, 10 Jun 2005 16:07:46 +0900, "Kirill A. Shutemov" writes: |Why does IO#read at the end of file without argument return "", but with a |interer return nil? IO#read with length argument tries to read a string, and returns nil if EOF is met. Thus it returns nil for this case. On the other hand, IO#read without length argument read a string until EOF, so that it tried to read whole data and zero bytes was read. That's the reason it returned an empty string. As a rule of thumb, IO#read() without any argument never returns nil. matz.