plebeia
Library
Module
Module type
Parameter
Class
Class type
Monad for asynchronous file system operations
val lift_result_lwt : ( 'a, Error.t ) Result_lwt.t -> 'a t
val raw_cursor : raw_cursor t
Get the current underlying cursor
val chdir_parent : unit t
Moves the cursor up 1 directory level. If the cursor is already at the root, it does nothing.
val chdir_root : unit t
Moves the cursor up to the root directory. If the cursor is already at the root, it does nothing.
Moves the cursor to a sub-directory specified by the path. If dig=true
, subdirectories are created if necessary.
File and directory access. It returns the current cursor and its view.
Set the tree pointed by the cursor
at the specified path.
The path must not be empty.
Note: there is no loop detection. It is the user's responsibility not to introduce a loop by this function.
copy src dst
sets the tree at src
to dst
. dst
must not be empty.
If the copy creates a loop, the function fails.
Create or update a regular file. Directories are created if necessary. The path must not be empty.
Remove a regular file or a directory, then returns Ok true
. The path must not be empty.
recursive=false : fails when the target is a directory recursive=true : removes the target recursively if it is a directory ignore_error=false : fails when the target does not exist ignore_error=true : does not fail even if the target does not exist
Returns true
if the target is really removed. Returns false
if the target does not exist.
Recursive removal of a directory The path must not be empty.
ignore_error=false : fails when the target does not exist ignore_error=true : does not fail even if the target does not exist
Returns true
if the target is really removed. Returns false
if the target does not exist.
val may_forget : unit t
Clear the memory cache of the tree under the current cursor, if it is already persisted on the disk.
do_then f op
executes f
against the current cursor, then performs op
.
val fold :
'a ->
Path.t ->
( 'a ->
Path.t ->
cursor ->
( [ `Continue | `Exit | `Up ] * 'a, Error.t ) Stdlib.result Lwt.t ) ->
'a t
folding
- `Continue: if the item is a directory, its items are recursively folded
- `Up: if the item is a directory, its items are skipped
- `Exit: terminate the folding immediately and returns the accumulator as the final result of
fold