Ruby/File Directory/close a file

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск
м (1 версия: Импорт выборки материалов по Ruby)
 

Текущая версия на 17:57, 13 сентября 2010

a file handle/object is assigned to f directly.

# You close the file handle manually with the close method at the end.
f = File.new("text.txt", "r")
puts f.gets
f.close