[erlang-patches] Support ** for recursion in filelib:wildcard
Wed Mar 14 14:34:53 CET 2012
Just a comment, without reading the patch.
I don't know how this is done in bash, but in zsh there is also ***
expansion. While ** expands to any level of directories, *** will
also include symbolic links in its expansion. This is of course
"unsafe" in the sense that symlinked directories outside of the tree
you are working on will be included if there are links to the outside.
It can also quite easily expand to an infinite size if there are
symlinks that point to any of their ancestors.
Not yet a suggestion for adding this feature to the patch, but at this
stage only a comment on the caveat of expanding symbolic links.
2012/3/14 José Valim <>:
> Here is an updated patch for ** support in filelib:wildcard().
> git fetch git://github.com/josevalim/otp.git fixed_double_star
> Quoting from bash documentation:
> Two adjacent *'s used as a single pattern will match all files and zero or
> more directories and subdirectories.
> I have tested this against Bash 4.2 implementation (previously I was using
> Ruby's implementation as basis). Since I didn't know there was a difference
> between Ruby and Bash, I removed any reference to Ruby in the commit
> I have also kept the current filelib:wildcard() behavior of returning files
> that start with dot ".". Bash by default does not return files starting with
> "." in wildcards.
> I have also improved the test coverage, documentation and added some
> erlang-patches mailing list
More information about the erlang-patches