From: yermej Date: 2007-11-22T00:25:03+09:00 Subject: Re: File fun! How would you... On Nov 21, 9:00 am, Casimir wrote: > ...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"] require 'find' src = "/" index = [] filetypes = [".jpg", ".png", ".gif", ".bmp"] Find.find(src) do |path| index << path if filetypes.include? File.extname(path) end