From: Vladimir Sizikov Date: 2008-05-23T19:43:47+09:00 Subject: Re: Returning duplicate values from Dir.glob Hi guys, Thank you for great responses! I also double-checked that Perl's glob also returns duplicates in this test case. Given the great experience with spec-related questions, I exepect there will be more of them here in the future! :) Also, we really need a proper bug tracking to report spec/rubyspec related issues reliably. Thanks, --Vladimir On Thu, May 22, 2008 at 8:49 PM, Nobuyoshi Nakada wrote: > Hi, > > At Fri, 23 May 2008 01:39:46 +0900, > Vladimir Sizikov wrote in [ruby-core:16849]: >> Essentially, the directory/file structure is described here: >> http://github.com/brixen/rubyspec/tree/master/1.8/core/dir/fixtures/common.rb#L29 >> >> And the pattern used in Dir.glob is: >> '**/*fil?{,.}*' > > OK, it's not a bug. > > You use brace expansion, which is expanded before "true" > globbing. Therefore it is equvalent to Dir.glob('**/*fil?*') + > Dir.glob('**/*fil?.*'), and both match to that name. All of > bash, ksh and zsh work in this manner. > > -- > Nobu Nakada > >