From: Newb Newb Date: 2009-01-27T15:32:41+09:00 Subject: Help on Directory Iteration Hi People i have never done file or Directory manipulations before. now in my form i have given date field and search button. if the user enters date and clicks the search button,accoding to the date entered it has to search for the folder in the ChatHistory folder for example user enters date like 2009-01-23 means it has to search for the folder which named 2009-01-23. if the foder exists again it has to be iterated when i do this i get error. folder structure would be ChatHistory has one folder like 2009-01-23 has two folder namely test and user these two folders contain 2 files each. My code starts here if params[:first_name].blank? and params[:second_name].blank? and !params[:e_date][0].blank? and params[:e_date][1].blank? puts "frtst date is not blank others are blank" Dir.foreach("ChatHistory") do |f| if f == params[:e_date][0] puts "there:" Dir.foreach(f) do |p| puts p end end end Pls Kindly help me up -- Posted via http://www.ruby-forum.com/.