ruby/sample/dir.rb

13 строки
187 B
Ruby

# directory access
# list all files but .*/*~/*.o
dirp = Dir.open(".")
for f in dirp
case f
when /\A\./, /~\z/, /\.o/
# do not print
else
print f, "\n"
end
end
dirp.close