package irmin-pack
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2a1e6a7577e498fbfeb678d666da210dc48d1344637e8ecb653e1dd88c640b5f
sha512=3fb6f49a1af2f8bab1df5b6f5affaaa09f09fe892a08eb2d9de58138e56646d4a6797f3c087b22875e36e3411218ab2435fe5437ac78f323dd661932af021fad
doc/irmin-pack.unix/Irmin_pack_unix/Dispatcher/Make/argument-1-Fm/Control/index.html
Module Fm.Control
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.
module Io = Ioval create_rw :
path:string ->
overwrite:bool ->
Irmin_pack_unix__.Control_file_intf.Payload_v4.t ->
(t, [> Io.create_error | Io.write_error ]) resultCreate a rw instance of t by creating a control file.
type open_error := [ | `Corrupted_control_file| `Io_misc of Io.misc_error| `No_such_file_or_directory| `Not_a_file| `Closed| `Unknown_major_pack_version of string
]val open_ : path:string -> readonly:bool -> (t, [> open_error ]) resultCreate a rw instance of t by reading an existing file at path.
val close : t -> (unit, [> Io.close_error ]) resultval payload : t -> Irmin_pack_unix__.Control_file_intf.Payload_v4.tpayload 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 := [ | `Corrupted_control_file| `Io_misc of Io.misc_error| `Closed| `Rw_not_allowed| `Unknown_major_pack_version of string
]val reload : t -> (unit, [> reload_error ]) resultRW 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.
val set_payload :
t ->
Irmin_pack_unix__.Control_file_intf.Payload_v4.t ->
(unit, [> Io.write_error ]) resultRW mode
Write a new payload on disk.
RO mode
Always returns an error.
val readonly : t -> boolval fsync : t -> (unit, [> Io.write_error ]) resultRW mode
Tell the OS to fush its internal buffers.
RO mode
Always returns Error `Ro_not_allowed.