[erlang-questions] filelib:fold_files doesnt work for symlink anymore (on Erlang/OTP 17)?

Zhibo Wei zweicmu@REDACTED
Wed Jul 9 10:49:31 CEST 2014


Here is how my src dict look like:
src/
├── 1.erl
├── 2.erl
├── 3.src
└── symlink -> ../../xxx/yyy/

and ' ../../xxx/yyy/' contains several '.proto' files

Here is what I did in erl console:
1> filelib:fold_files("src", ".*\\.proto$", true, fun(F, Acc) -> [F | Acc]
end, []).
[]
2> filelib:fold_files("src", ".*\\.erl$", true, fun(F, Acc) -> [F | Acc]
end, []).
["/home/xxx/src/1.erl",
 "/home/xxx/src/2.erl"]
3> filelib:fold_files("src/symlink", ".*\\.proto$", true, fun(F, Acc) -> [F
| Acc] end, []).
["/home/xxx/src/symlink/1.proto",
 "/home/xxx/src/symlink/2.proto"]

But as I remembered, filelib:fold_files works fine before I upgrade erlang.
My erlang version is 'Erlang/OTP 17 [erts-6.1] [source] [64-bit]' and it's
running on Ubuntu 14.04

Is this a known issue of Erlang? Is there any work around to make this
working other than downgrade erlang? Please let me know, thanks a lot!

Thanks,
Zhibo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140709/8351e80e/attachment.htm>


More information about the erlang-questions mailing list