package mfat
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=a3dcb21bb74a9b17bb21bbd6b8f2e56d687d85ff732841c3ddb425a9be9cf1e3
sha512=a70ce27dc2e81c0a7515e64fdbdd695f9ef57f35a213a0ad6ceaed3fbe88439087100d2b3f2bc256228c8e169c28c88a9f6d47355d93856bb49bdb86ff745d1d
doc/mfat.bos/Mfat_bos/Make/index.html
Module Mfat_bos.MakeSource
Parameters
module Blk : Mfat.BLOCKSignature
Path operations
exists 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).
Matching path patterns against the file system
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.