summaryrefslogtreecommitdiff
path: root/sample/dir.rb
blob: 3349dc7b6d457c88487be186c766ce8c865f8b30 (plain)
1
2
3
4
5
6
7
8
9
10
# directory access
# list all files but .*/*~/*.o
dirp = Dir.open(".")
dirp.rewind
for f in dirp
  if !(~/^\./ || ~/~$/ || ~/\.o/)
    print f, "\n"
  end
end
dirp.close