Over a million developers have joined DZone.

Ruby Directory Access Example

·

# 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
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}