Yocaml.BatchSourceAllows you to run batches of actions (on lists, directories, etc.)
iter list action cache Executes the given action on all element of the given list. The cache is passed from call to call. see: Action.batch_list
val fold :
state:'a ->
'b list ->
('b -> 'a -> Cache.t -> (Cache.t * 'a) Eff.t) ->
Cache.t ->
(Cache.t * 'a) Eff.tfold ~state list action cache Executes the given action on all element of the given list. The cache is passed from call to call and instead of iter, you can maintain your own additional state. see: Action.fold_list
val iter_children :
?only:[ `Both | `Directories | `Files ] ->
?where:(Path.t -> bool) ->
Path.t ->
(Path.t -> Action.t) ->
Action.titer_children ?only ?where path action cache Executes the given action on all child files of the given path. The cache is passed from call to call. see: Action.batch
val fold_children :
?only:[ `Both | `Directories | `Files ] ->
?where:(Path.t -> bool) ->
state:'a ->
Path.t ->
(Path.t -> 'a -> Cache.t -> (Cache.t * 'a) Eff.t) ->
Cache.t ->
(Cache.t * 'a) Eff.tfold_children ?only ?where ~state path action cache Executes the given action on all child files of the given path. The cache is passed from call to call and instead of iter_children, you can maintain your own additional state. see: Action.fold
iter_files is iter_children ~only:`Files.
val iter_tree :
?where:([ `Directory | `File ] -> Path.t -> bool) ->
Path.t ->
(Path.t -> Action.t) ->
Action.titer_tree ?where path action will apply the action passed as an argument to all files, recursively in the directory tree located at path. You can use the second parameter of the where predicate to distinguish whether you are observing a file or a directory.
val fold_tree :
?where:([ `Directory | `File ] -> Path.t -> bool) ->
state:'a ->
Path.t ->
(Path.t -> 'a -> Cache.t -> (Cache.t * 'a) Eff.t) ->
Cache.t ->
(Cache.t * 'a) Eff.tfold_tree ?where ~state path action is like iter_children but you can maintain your own additional state.
val fold_files :
?where:(Path.t -> bool) ->
state:'a ->
Path.t ->
(Path.t -> 'a -> Cache.t -> (Cache.t * 'a) Eff.t) ->
Cache.t ->
(Cache.t * 'a) Eff.tfold_files is fold_children ~only:`Files.
iter_directories is iter_children ~only:`Directories.