package irmin-pack

  1. Overview
  2. Docs
Irmin backend which stores values in a pack file

Install

Dune Dependency

Authors

Maintainers

Sources

irmin-3.5.1.tbz
sha256=cd788a8d3f4a3dd18dc160a153d4aec91eaf6b0fb41ad41464d26c79c304a98e
sha512=4f97862678d35e0b4aa814a1df51d6f8c59bcf5b611c73f0a475f9b5386ca42a4a18e65ce80fc425ddad93fcdacfcb563c52f6423777610a0bc567902f4db088

doc/irmin-pack.unix/Irmin_pack_unix/Control_file/Make/index.html

Module Control_file.MakeSource

Abstraction for irmin-pack's control file.

It is parameterized with Io, a file system abstraction (e.g. unix, mirage, eio_linux).

None of the functions raise exceptions.

Parameters

module Io : Io.S

Signature

Sourcemodule Io = Io
Sourcetype t
Sourceval create_rw : path:string -> overwrite:bool -> Irmin_pack_unix__.Control_file_intf.Payload_v4.t -> (t, [> Io.create_error | Io.write_error ]) result

Create a rw instance of t by creating a control file.

type open_error := [
  1. | `Corrupted_control_file
  2. | `Io_misc of Io.misc_error
  3. | `No_such_file_or_directory
  4. | `Not_a_file
  5. | `Closed
  6. | `Unknown_major_pack_version of string
]
Sourceval open_ : path:string -> readonly:bool -> (t, [> open_error ]) result

Create a rw instance of t by reading an existing file at path.

Sourceval close : t -> (unit, [> Io.close_error ]) result
Sourceval payload : t -> Irmin_pack_unix__.Control_file_intf.Payload_v4.t

payload t is the payload in t.

That function doesn't perform IO.

RW mode

payload t is the payload, as it was written to the file system.

RO mode

payload t is the payload, as it was seen during open_ or during the most recent reload.

type reload_error := [
  1. | `Corrupted_control_file
  2. | `Io_misc of Io.misc_error
  3. | `Closed
  4. | `Rw_not_allowed
  5. | `Unknown_major_pack_version of string
]
Sourceval reload : t -> (unit, [> reload_error ]) result

RW mode

Always returns an error.

RO mode

Reread the file on disk.

If the file changed since the last read, the payload in t is updated to match the content of the file.

Sourceval set_payload : t -> Irmin_pack_unix__.Control_file_intf.Payload_v4.t -> (unit, [> Io.write_error ]) result

RW mode

Write a new payload on disk.

RO mode

Always returns an error.

Sourceval readonly : t -> bool
Sourceval fsync : t -> (unit, [> Io.write_error ]) result

RW mode

Tell the OS to fush its internal buffers.

RO mode

Always returns Error `Ro_not_allowed.

OCaml

Innovation. Community. Security.