From: wconrad@... Date: 2002-05-09T03:55:20+09:00 Subject: Re: gets and eof? I can't answer your actual question, but I know that gets seems to reliably return nil on eof. I'm not sure what the optimal way of testing for eof is, but the nil trick has worked well for me whether I'm reading from stdin, a socket, or a file. Wayne Conrad On Thu, May 09, 2002 at 03:42:30AM +0900, Paul Brannan wrote: > ... > loop do > line = $stdin.gets > break if $stdin.eof? > puts "<-- #{line}" > end > > ...when I type a > line, it doesn't show up until the second line is typed. This happens > whether I am using $stdin or whether I am using a socket (returned by > TCPServer#accept). Why does this happen in the second case?