diff options
Diffstat (limited to 'ruby_1_8_6/sample/dir.rb')
-rw-r--r-- | ruby_1_8_6/sample/dir.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ruby_1_8_6/sample/dir.rb b/ruby_1_8_6/sample/dir.rb new file mode 100644 index 0000000000..b627383946 --- /dev/null +++ b/ruby_1_8_6/sample/dir.rb @@ -0,0 +1,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 |