summaryrefslogtreecommitdiffstats
path: root/sample/dir.rb
blob: b627383946d34616322125fa2bbbaf814c8af90c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# directory access
# list all files but .*/*~/*.o
dirp = Dir.open(".")
for f in dirp
  case f
  when /^\./, /~$/, /\.o/
    # do not print
  else
    print f, "\n"
  end
end
dirp.close