Saturday, September 12, 2009

Dir.glob to get filenames in directory


# Glob for filenames in path
Dir.glob('some/path/name')

# Use File.join for pathname which autocorrects for Windows
Dir.glob(File.join(File.dirname(__FILE__), 'some', 'path', 'name'))

No comments:

Blog Archive