OSDN Git Service

ruby-1.9.1-rc1
[splhack/AndroidRuby.git] / lib / ruby-1.9.1-rc1 / sample / dir.rb
1 # directory access
2 # list all files but .*/*~/*.o
3 dirp = Dir.open(".")
4 for f in dirp
5   case f
6   when /^\./, /~$/, /\.o/
7     # do not print
8   else
9     print f, "\n"
10   end
11 end
12 dirp.close