Mfat_bos.MakeSourcemodule Blk : Mfat.BLOCKexists t p is true if p exists for the file system and false otherwise.
must_exist p is Ok p if p exists for the file system and an error otherwise.
val delete :
blk Mfat.t ->
?must_exist:bool ->
?recurse:bool ->
Fpath.t ->
(unit, [> `Msg of string ]) resultdelete ~must_exist ~recurse p deletes the path p. If must_exist is true (defaults to false) an error is returned if p doesn't exist. If recurse is true (defaults to false) and p is a directory, no error occurs if the directory is non-empty: its contents is recursively deleted first.
stat p is p's file information.
type 'a error =
Fpath.t ->
('a, [ `Msg of string ]) result ->
(unit, [ `Msg of string ]) resultThe type for managing fold errors.
The type for specifying elements being folded over.
The type for controlling directory traversals.
val fold :
?err:'a error ->
?dotfiles:bool ->
?elements:elements ->
?traverse:traverse ->
blk Mfat.t ->
(Fpath.t -> 'acc -> 'acc) ->
'acc ->
Fpath.t list ->
('acc, [ `Msg of string ]) resultfold err dotfiles elements traverse fn acc paths folds over the list of paths paths traversing directories according to traverse (defaults to `Any) and selecting elements to fold over according to elements (defaults to `Any).
If dotfiles is false (default) both elements and directories to traverse that start with a . are skipped. . and .. entries are always skipped.
err manages fold errors (see error).
val matches :
blk Mfat.t ->
?dotfiles:bool ->
Fpath.t ->
(Fpath.t list, [> `Msg of string ]) resultmatches t ~dotfiles pat is the list of paths in the file system that match the path pattern pat. If dotfiles is false (default) elements that start with a . are skipped.
val query :
blk Mfat.t ->
?dotfiles:bool ->
?init:Pat.defs ->
Fpath.t ->
((Fpath.t * Pat.defs) list, [> `Msg of string ]) resultquery t ~dotfiles ~init pat is like matches except each matching path is returned with an environment mapping pattern variables to their matched part.