--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Returns true if ios is at end of file that means there are no more data to read. The stream must be opened for reading or an IOError will be raised. - !ruby/struct:SM::Flow::VERB body: " f = File.new("testfile")\n dummy = f.readlines\n f.eof #=> true\n" - !ruby/struct:SM::Flow::P body: If ios is a stream such as pipe or socket, IO#eof? blocks until the other end sends some data or closes it. - !ruby/struct:SM::Flow::VERB body: " r, w = IO.pipe\n Thread.new { sleep 1; w.close }\n r.eof? #=> true after 1 second blocking\n\n r, w = IO.pipe\n Thread.new { sleep 1; w.puts "a" }\n r.eof? #=> false after 1 second blocking\n\n r, w = IO.pipe\n r.eof? # blocks forever\n" - !ruby/struct:SM::Flow::P body: Note that IO#eof? reads data to a input buffer. So IO#sysread doesn't work with IO#eof?. full_name: IO#eof is_singleton: false name: eof params: | ios.eof => true or false ios.eof? => true or false visibility: public