From: Casimir P Date: 2007-10-25T01:30:01+09:00 Subject: Ruby is simple? NooooT! Hehe whoever said that ruby is not verbose was WRONG!! ;) I mean look at the code below! All this just to find subdirectories and to list all the jpg files inside!! So... NOT!!! :) I hope the code posts well.. #code starts here imgpath = "img/" def seekPhotoDirs(path) require 'find' photodirs = Array.new Find.find(path) do |item| if FileTest.directory?(item) if item != path #ei haluta t辰t辰 samaa hakemistoa puts indexImages(item) end end end return photodirs end def indexImages(dir) dir.each { |d| Dir.entries(d).each { |filu| nn = filu.to_s ext = filu.downcase.split(".").last if ( ext == "png" || ext == "jpg") puts filu end } } end puts seekPhotoDirs(imgpath) #code ends here Greetings to whytheluckystiff! Outfoxed, not sourced. Csmr -- Casimir Pohjanraito Art Portfolio: http://csmr.dreamhosters.com