New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dir.glob doesn't support recursive matching using double star ("**") wildcard #1433
Comments
Yes, unfortunately the backing libc call glob(3) doesn't support it and everybody seems to reimplement it all the time. |
thanks, i see the point. |
To clarify, we totally want this, it's just that nobody had time or motivation yet to do a full Crystal glob implementation. |
Yes! We know this now for a long time but it's not a simple thing to do. As @jhass says, we would really love having this functionality, though. If somebody want's to tackle this, please let us know! It should be a fun little project, plus it's very easy to test. |
I suppose that any glob pattern can be translated into a regex? If yes, then the implementation should be quite easy. We will just match the paths using the regex. Later, we might implement a hand-written glob matcher for efficiency. If there is a |
Or maybe keep using LibC.glob to match individual files/folders but manually traverse directories on **. |
Although I don't know whether this is intended or not,
Dir.glob
doesn't support recursive matching using double star ("**") wildcard.when the below directory tree and the program are given:
while when I run this code as Ruby I get:
as Crystal I get:
Crystal 0.7.7 on OS X.
The text was updated successfully, but these errors were encountered: