From: Brian Candler Date: 2003-04-05T20:51:51+09:00 Subject: Re: Strangeness in Find.find On Sat, Apr 05, 2003 at 08:43:17PM +0900, Kent Dahl wrote: > > def find(*paths) # :yield: path > > paths.collect!{|d| d.dup} # << ?! > > while file = paths.shift > > ... etc > > > > For each element of the 'paths' array, it is duplicating that entry, then > > collecting those duplicates into a new array, > > I do not think it makes a new array. It uses the same array object. > Notice the "!". self.doh! In that case though, I can't see why it is taking dup copies of the elements: it passes them to File.lstat, Dir.open and File.join, but I don't think any of those modify their string arguments. Regards, Brian.