package irmin

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include IO

File-system abstractions

type path = string

The type for paths.

Read operations

val rec_files : path -> string list Lwt.t

rec_files dir is the list of files recursively present in dir and all of its sub-directories. Return filenames prefixed by dir.

val file_exists : path -> bool Lwt.t

file_exist f is true if f exists.

val read_file : path -> Cstruct.t option Lwt.t

Read the contents of a file using mmap.

Write Operations

val mkdir : path -> unit Lwt.t

Create a directory.

type lock

The type for file locks.

val lock_file : path -> lock

lock_file f is the lock associated to the file f.

val write_file : ?temp_dir:path -> ?lock:lock -> path -> Cstruct.t -> unit Lwt.t

Atomic writes.

val test_and_set_file : ?temp_dir:string -> lock:lock -> path -> test:Cstruct.t option -> set:Cstruct.t option -> bool Lwt.t

Test and set.

val remove_file : ?lock:lock -> path -> unit Lwt.t

Remove a file or directory (even if non-empty).

val clear : unit -> unit Lwt.t
val set_listen_hook : unit -> unit
OCaml

Innovation. Community. Security.