From: Charles Oliver Nutter Date: 2009-02-15T03:47:14+09:00 Subject: [ruby-core:22090] Re: Dir.glob and duplicates? Nobuyoshi Nakada wrote: > Hi, > > At Sat, 14 Feb 2009 16:35:30 +0900, > Charles Oliver Nutter wrote in [ruby-core:22065]: >> The spec MRI produces dupes for is: >> >> Dir.glob recursively matches directories with '**/' >> at core/dir/shared/glob.rb:205 > > The pattern at line 204 is '**/*fil?{,.}*', which is equivalent > to to Dir.glob('**/*fil?*')+Dir.glob('**/*fil?.*'), so > "subdir_two/nondotfile.ext" matches against both. That is, > brace expansions needs attention to use. I think the presence of duplicates is a glob implementation detail that should not be specified. Surely different implementations are going to produce difference results. I don't think we should specify when dupes are expected to occur, and glob's specification should either be "may produce dupes" or "will not produce dupes". - Charlie