summaryrefslogtreecommitdiff
path: root/sample/dir.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/dir.rb')
-rw-r--r--sample/dir.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/sample/dir.rb b/sample/dir.rb
index f4c3d17..f269c56 100644
--- a/sample/dir.rb
+++ b/sample/dir.rb
@@ -1,9 +1,10 @@
+# directory access
+# list all files but .*/*~/*.o
dirp = Dir.open(".")
dirp.rewind
for f in dirp
- if (~/^\./ || ~/~$/ || ~/\.o/)
- else
- print(f, "\n")
+ unless (~/^\./ || ~/~$/ || ~/\.o/)
+ print f, "\n"
end
end
dirp.close