In Ruby, Dir.glob("**/*.rb") (for instance) doesn’t traverse symlinked directories. Is it possible to get the ** to traverse symlinks?
I’m using two gems which find files this way, but I need them to see files within a symlinked directory.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Jonathan’s clever and cunning approach is great, capable of slashing through hordes of symlinks with but a mere flick of a few asterisks, muahaha. However, it has the unfortunate side-effect of not returning immediate-child matches. An improved version might be:
Which will (in my tests) do both follow one symlink and return immediate children.