Ruby/File Directory/close a file

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

Версия от 17:10, 26 мая 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