package irmin-fs

  1. Overview
  2. Docs

Module Irmin_fs.IO_memSource

include IO

File-system abstractions

Sourcetype path = string

The type for paths.

Read operations

Sourceval 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.

Sourceval file_exists : path -> bool Lwt.t

file_exist f is true if f exists.

Sourceval read_file : path -> string option Lwt.t

Read the contents of a file using mmap.

Write Operations

Sourceval mkdir : path -> unit Lwt.t

Create a directory.

Sourcetype lock

The type for file locks.

Sourceval lock_file : path -> lock

lock_file f is the lock associated to the file f.

Sourceval write_file : ?temp_dir:path -> ?lock:lock -> path -> string -> unit Lwt.t

Atomic writes.

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

Test and set.

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

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

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

Innovation. Community. Security.