Chris Pressey <>
Wed Sep 17 01:00:15 CEST 2003


No offense to Mr. Gustavsson, but filelib:fold_files/5 looks like it was
written while he was asleep :)

Attached is a patch which makes it (at least) work.  But I think it
would be good to consider a change to its definition first.

With the present behaviour, the callback never sees directory entries
themselves.  So, for example, empty directories are never detected.  I
think the behaviour would be more useful if it called the fun for both
plain files and directories.  The callback could also accept a flag,
like fun(Filename, IsDir, Acc), so that it doesn't have to do the test
itself (since fold_files/5 already does it anyway.)

What do you think?

Other than that one issue, I like the filelib module a lot!  Keep up the
good work.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: filelib.erl.diff
URL: <>

More information about the erlang-bugs mailing list