From: Casimir Date: 2007-11-22T00:00:01+09:00 Subject: File fun! How would you... ...index in a hash... ...all directories under 'src'... ...that contain filetypes in 'ft[]'... ...without getting lost in arrays inside arrays.. #Here is my try src="/" tmpindex = [] filetypes = [".jpg", ".png", ".gif", ".bmp"] filetypes.each { |typ| tmpindex << Dir[src+"**/*"+typ] } index={} tmpindex.each { |fpath| dirpath = File.dirname(File.expand_path(fpath.to_s)) index[dirpath] = File.basename(fpath.to_s) } puts index #bleed #end