Deprecated.FindA folder is a function suitable as the f parameter of fold.
noop is a folder that simply returns its accumulator.
cons is (fun _ -> cons).
These combinators convert functions of various shapes into folders.
(igndepth f) returns a folder that ignores the depth parameter.
f should be a function like List.cons.
Example: collect all files into a list (assuming no errors):
(fold Find.(igndepth List.cons) [] ".")(whenfile p f) returns a folder that invokes (f depth path acc) iff (p path = true).
Example: (fold Find.(whenfile Sys.is_directory cons) [] ".")
(whenfile p f) returns a folder that invokes (f depth path acc) iff (p path = true).
Example: (fold Find.(whenfile Sys.is_directory cons) [] ".")
(maxdepth d f) returns a folder that invokes f iff the depth <= d.
(maxdepth d f) returns a folder that invokes f iff the depth <= d.
(mindepth d f) returns a folder that invokes f iff the depth >= d.
(mindepth d f) returns a folder that invokes f iff the depth >= d.
(ignore f) ignores errors, but still passes the pathname and accumulator to f.
(log hdl f) logs errors by passing a string representation of the exception to hdl, but still passes the pathname and accumulator to f.
Note that most errors will be Sys_error's and the string representation will contain the pathname.
(log hdl f) logs errors by passing a string representation of the exception to hdl, but still passes the pathname and accumulator to f.
Note that most errors will be Sys_error's and the string representation will contain the pathname.
(prerr f) is (log prerr_endline f).
(prerr f) is (log prerr_endline f).