From: Thomas Sondergaard Date: 2005-04-03T19:14:42+09:00 Subject: Re: File.fnmatch and ** nobu.nokada@softhome.net wrote: > Hi, > > At Fri, 1 Apr 2005 18:54:44 +0900, > Thomas Sondergaard wrote in [ruby-talk:136264]: > >>Dir.glob('**/*') matches directories recursively, but >>File.fnmatch('**/*', "a/b/c", File::FNM_PATHNAME) returns false. I >>thought (from reading the docs at ruby-doc.org) that the patterns are >>supposed to be the same. > > > $ ruby18 -v -e 'p File.fnmatch("**/*", "a/b/c")' > ruby 1.8.2 (2005-03-31) [i686-linux] > true > Yes, well the following returns true as well, which is not desirable. I need to pass the File::FNM_PATHNAME for fnmatch to treat the string as a path and not a file name. [ts@argon qtruby-1.0.8]$ ruby -v -e 'p File.fnmatch("*", "a/b/c")' ruby 1.8.2 (2004-12-25) [i686-linux] true I just wonder why only Dir.glob understands the ** pattern. Thomas