Ruby/File Directory/Dir.open

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

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

Версия 17:10, 26 мая 2010

Open a folder with block logics

Dir.open("mydir") { |d| d.each { |x| puts x } }



Open a folder with grep as a filter

Dir.open("mydir") { |d| d.grep /file/ }