Ruby/File Directory/eof
Материал из Wiki.crossplatform.ru
Версия от 17:57, 13 сентября 2010; ViGOur (Обсуждение | вклад)
How to Know When You"re at the End of a File
f = File.new("test.txt", "r") catch(:end_of_file) do loop do throw :end_of_file if f.eof? puts f.gets end end f.close