Up

module Find

: sig

Unix like find.

#
type t
#
type file_info = string * Core.Std.Unix.stats
#
module Options : sig
#
type error_handler =
# | Ignore
# | Print
# | Raise
# | Handle_with of string -> unit
#
type t = {
# min_depth
: int;
# max_depth
: int option;
: bool;
# on_open_errors
: error_handler;
# on_stat_errors
: error_handler;
# filter
: (file_info -> bool) option;
# skip_dir
: (file_info -> bool) option;
# relative_paths
: bool;
}
#
val default : t
#
val ignore_errors : t
end
#
val create : ?options:Options.t -> string -> t

create ?options dir create a Find.t based in dir

#
val next : t -> file_info option

next t return the next file from the collection of valid files in t or None if no more files remain

#
val close : t -> unit

close t drops all the resources associated with t. It is a mistake to attempt to use t again. Any Find.t will be automatically closed after the last file is read by any means.

#
val iter : t -> f:(file_info -> unit) -> unit

iter t ~f calls f on every file in t

#
val fold : t -> init:'a -> f:('a -> file_info -> 'a) -> 'a

fold t ~init ~f folds f over the files in t

#
val to_list : t -> file_info list

to_list t returns all of the remaining files in t as a list in the order they would have been returned by subsequent calls to next

#
val find_all : ?options:Options.t -> string -> file_info list

find_all ?options dir short for to_list (create ?options dir)

end