From: Robert Klemme Date: 2008-06-02T16:56:59+09:00 Subject: Re: Find files 2008/6/2 Clement Ow : > botp wrote: >> On Fri, May 30, 2008 at 10:46 AM, Clement Ow >> wrote: >>> d= $d1 >> >> where does this $d1 come from? > It is a date object in the format of MM-YY, in which this object is used > for printing datestamped folders. >> >>> src1.each do |folder| >>> Find.find(folder + "/") do |file| >>> : >>> : >> >> you cut a lot of text. pls show full source, to make our life easier.. >>>>> src1 << file unless $file_exception[i].each{|x| /#{x}/ =~ File.basename(file)} > > Actually how my code works is by finding all the files and then have all > the exclusions that will exclude the files in the block and then finally > executing the move, copy or delete command. > > But it is just this selecting and bringing the exclusions part that is > giving me quite abit of problems. But in any case here goes my code: > > def copy_r > end #copy Chances are that you can condense that code *a lot*. Did you see my reply? robert -- use.inject do |as, often| as.you_can - without end