Navindra Umanee
1/23/2005 11:55:00 AM
Hi,
If I run the following code:
# "empty" is a 0-byte file in the current directory
File.open("empty") { |file|
print "file.read should return nil\n" if file.eof?
print "file.read: "
print file.read
print "\n"
}
read = File.open("empty").read
print "read is NOT nil\n" if read
--------------------------------------
I get:
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.
Thanks,
Navin.