Forum: Ruby-core [ruby-trunk - Bug #6977][Open] Ruby 1.9.3 Dir.glob strange recursive match behaviour

Posted by jasonling (Jason Ling) (Guest)
on 2012-09-04 10:50
(Received via mailing list)
Issue #6977 has been reported by jasonling (Jason Ling).

----------------------------------------
Bug #6977: Ruby 1.9.3 Dir.glob strange recursive match behaviour
https://bugs.ruby-lang.org/issues/6977

Author: jasonling (Jason Ling)
Status: Open
Priority: Urgent
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


Assuming a directory structure of:

a/b/c/d/e/f/g/h

I am trying to find 'h' via:

Dir.glob('a/**/f/g/h')

However this is not working. Any ideas?

You can try the test case below:

$ /usr/bin/ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
$ mkdir -p a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/**/*')"
a/b
a/b/c
a/b/c/d
a/b/c/d/e
a/b/c/d/e/f
a/b/c/d/e/f/g
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/**/h')"
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/**/g/h')"
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/**/f/g/h')"
**nothing**
Posted by cyberkni (Dan Van Derveer) (Guest)
on 2013-01-28 20:30
(Received via mailing list)
Issue #6977 has been updated by cyberkni (Dan Van Derveer).


This revision has not been released as of 1.9.3p374 which is a bummer 
since this was fixed quite a while ago.

Is there a reason this hasn't been released?
----------------------------------------
Bug #6977: Ruby 1.9.3 Dir.glob strange recursive match behaviour
https://bugs.ruby-lang.org/issues/6977#change-35690

Author: jasonling (Jason Ling)
Status: Closed
Priority: Urgent
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


Assuming a directory structure of:

a/b/c/d/e/f/g/h

I am trying to find 'h' via:

Dir.glob('a/**/f/g/h')

However this is not working. Any ideas?

You can try the test case below:

$ /usr/bin/ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
$ mkdir -p a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/**/*')"
a/b
a/b/c
a/b/c/d
a/b/c/d/e
a/b/c/d/e/f
a/b/c/d/e/f/g
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/**/h')"
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/**/g/h')"
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/**/f/g/h')"
**nothing**
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.