From: Florian Gross Date: 2005-01-23T21:20:54+09:00 Subject: Re: File.read not returning nil [newbie] Navindra Umanee wrote: > file.read should return nil > file.read: nil > read is NOT nil > > This is completely baffling me. Can anyone explain what is going on? > I apologise if this is an obvious question, any pointers would be > appreciated. irb(main):009:0> File.open("NUL") { |f| f.read } => "" It is not returning nil, it returns an empty String instead. Probably best to use p() or IRB when you're checking things like this. There's also File.read(fn) which might help with simplifying code.