Bug in filelib

WILLIAMS Dominic D.WILLIAMS@REDACTED
Tue Feb 3 12:52:25 CET 2004


Hello,

I believe there is a bug in filelib:fold_files/5 (in R9C).
>From looking at the code I believe the fold_files/6 subfunction
is just missing a clause at the end for the empty list:

fold_files([],_,_,_,_,Acc) ->
    Acc.


Here is my error report:

10> filelib:fold_files("c:/williams/tmp","[A-z]*\.erl",true,fun(F,Acc)->[{F,file
lib:last_modified(F)}|Acc] end,[]).

=ERROR REPORT==== 3-Feb-2004::12:38:11 ===
Error in process <0.38.0> with exit value: {function_clause,[{filelib,fold_files
,[[],"c:/williams/tmp",{concat,{concat,{concat,{concat,{kclosure,{char_class,[{6
5,122}]}},{comp_class,"\n"}},101},114},108},true,#Fun<erl_eval.12.41869059>,[{"c
:/williams/tmp/xhtml.erl",{{2004,1,28},{14,32,6}}},{"c:/williams/tmp/test.erl",.
.. 

** exited: {function_clause,[{filelib,fold_files,
                                      [[],
                                       "c:/williams/tmp",
                                       {concat,
                                           {concat,
                                               {concat,
                                                   {concat,
                                                       {kclosure,
                                                           {char_class,
                                                               [{...}]}},
                                                       {comp_class,"\n"}},
                                                   101},
                                               114},
                                           108},
                                       true,
                                       #Fun<erl_eval.12.41869059>,
                                       [{"c:/williams/tmp/xhtml.erl",
                                         {{2004,1,28},{14,32,6}}},
                                        {"c:/williams/tmp/test.erl",
                                         {{2004,1,28},{15,24,52}}},
                                        {"c:/williams/tmp/cerl2.erl",
                                         {{2004,1,28},{16,37,54}}},
                                        {"c:/williams/tmp/xhtml.erl~",
                                         {{2004,1,8},{17,13,12}}},
                                        {"c:/williams/tmp/cerl2.erl~",
                                         {{2004,1,28},{16,37,8}}}]]},
                             {erl_eval,do_apply,5},
                             {shell,eval_loop,2}]} **


---

Regards,

Dominic Williams.



More information about the erlang-questions mailing list