readline raises an EOFError when it reaches the end of the file. : readline « File Directory « Ruby






readline raises an EOFError when it reaches the end of the file.


file = File.new( "yourFile.txt" )
file.readline 
file.readline 
file.readline 

 








Related examples in the same category

1.Readlines by