Up

module Async_find

: sig
#
type t
#
module Options : sig
#
type error_handler =
# | Ignore
# | Print
# | Raise
# | Handle_with of string -> unit Async.Std.Deferred.t
#
type t = {
# min_depth
: int;
# max_depth
: int option;
: bool;
# on_open_errors
: error_handler;
# on_stat_errors
: error_handler;
# filter
: (string * Async.Std.Unix.Stats.t -> bool Async.Std.Deferred.t) option;
# skip_dir
: (string * Async.Std.Unix.Stats.t -> bool Async.Std.Deferred.t) 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 -> (string * Async.Std.Unix.Stats.t) option Async.Std.Deferred.t

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 Async.Std.Deferred.t

close t drops all the resources associated with t. Attempting to use t again will raise an exception. Any Find.t will be automatically closed after the last file is read by any means.

#
val iter : t -> f:(string * Async.Std.Unix.Stats.t -> unit Async.Std.Deferred.t) -> unit Async.Std.Deferred.t

iter t ~f calls f on every file in t

#
val fold : t -> init:'a -> f:('a -> string * Async.Std.Unix.Stats.t -> 'a Async.Std.Deferred.t) -> 'a Async.Std.Deferred.t

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

#
val to_list : t -> (string * Async.Std.Unix.Stats.t) list Async.Std.Deferred.t

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 -> (string * Async.Std.Unix.Stats.t) list Async.Std.Deferred.t

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

end