From: "Peña, Botp" Date: 2009-01-27T17:11:18+09:00 Subject: Re: Help on Directory Iteration From: Newb Newb [mailto:revathy.p@angleritech.com] # Dir.foreach("ChatHistory") do |f| # if f == params[:e_date][0] # puts "there:" # Dir.foreach(f) do |p| # puts p # end # end # end hmm, folder/filnames are uniq for each level, so you should *not need to iterate that no? that is, Dir.foreach('ChatHistory/'+params[:e_date][0]) do |path| puts path unless %w(. ..).include? path end and i would also refrain using p as a var name ;)