Ruby/File Directory/File.exists

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

Версия от 17:57, 13 сентября 2010; ViGOur (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Does a file exist

File.file?( "yourFile.txt" ) # => true



File Inquiries

# tests whether a file exists before opening it
File::open("file.rb") if File::exists?( "file.rb" )