Currently this is how my code looks like: >delete=delete + 2 > folders = $del_path > delete_date = DateTime.now - delete > > regexp = Regexp.compile(/(\d{4}\d{2}\d{2})/) > > fileData = Struct.new(:name, :size) > deleted_files = [] > > folders.each do |folder| > Find.find(folder + "/") do |file| > match = regexp.match(File.basename(file)); > if match > puts file_date = DateTime.parse(match[1]) > size = File.stat(file).size > if delete_date > file_date > deleted_files << fileData.new(file,size) > puts "delete files: #{file} size: #{size} bytes" > #File.delete(file) > end > end > end > end Currently, when i specify the folder path to be C:/Test, it begins searching for files that are in C:/Test/New as well. So is there any way that the command doesnt traverse the folders to match the regexp? (i.e only match C:/Test if the path specified is C:/Test)Thanks in advance! -- Posted via http://www.ruby-forum.com/.