* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / sample / dir.rb
blobb627383946d34616322125fa2bbbaf814c8af90c
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