In article <35hnlgF4kmpdgU1 / individual.net>,
  Florian Gross <flgr / ccan.de> writes:

> Hm, it seems to return nil when you specify a count (even if you use 0) 
> argument. I'm not sure why it's like that. Maybe matz or somebody else 
> who has knowledge on this could answer...

io.read() and io.read(nil) returns always a string which may be empty.

io.read(n) with 0<n returns a non-empty string or nil.

io.read(0) return "" or nil in Ruby 1.8.
It returns always "" in Ruby 1.9.
-- 
Tanaka Akira