package git

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

Parameters

module FS : sig ... end

Signature

include module type of struct include FS end
type error = FS.error
type t = FS.t
val pp_error : error Fmt.t
val is_dir : t -> Fpath.t -> (bool, error) result Lwt.t
val is_file : t -> Fpath.t -> (bool, error) result Lwt.t
module File = FS.File
module Dir = FS.Dir
module Mapper = FS.Mapper
val has_global_watches : bool
val has_global_checkout : bool
val with_open_r : FS.t -> Fpath.t -> ([ `Read ] FS.File.fd -> ('a, [> `Open of Fpath.t * FS.error | `Move of Fpath.t * Fpath.t * FS.error ] as 'e) result Lwt.t) -> ('a, 'e) result Lwt.t

with_open_r t p f opens the file p in the file-system t with read-only mode and calls f on the resulting file-descriptor. When f completes, the file-descriptor is closed. Failure to close that file-descriptor is ignored.

val with_open_w : ?atomic:bool -> FS.t -> temp_dir:Fpath.t -> Fpath.t -> ([ `Write ] FS.File.fd -> ('a, [> `Open of Fpath.t * FS.error | `Move of Fpath.t * Fpath.t * FS.error ] as 'e) result Lwt.t) -> ('a, 'e) result Lwt.t

Same as with_open_r but the file p is opened in read-write mode. If atomic is set (it is by default), the application of f is guaranteed to be atomic. This is done by creating a temporary file and renaming it when all the work is done.