package irmin-pack
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=964512f77697947a73dd1875c634d6804e98f14167c5aadd3c4f85b5f30ffb53
sha512=d56d3285daa2dd36f1eaff867af5c8f44c61bba4de1a5c7bb5347652dbc460c343483ab61de1a9302f664af357eacc964dc5c8b4477f6d01372dc028b162e98b
doc/irmin-pack.unix/Irmin_pack_unix/Control_file/Make/index.html
Module Control_file.Make
Source
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
Signature
val create_rw :
path:string ->
overwrite:bool ->
Irmin_pack_unix__.Control_file_intf.Payload_v3.t ->
(t, [> Io.create_error | Io.write_error ]) result
Create 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
]
Create a rw instance of t
by reading an existing file at path
.
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 := [
| `Corrupted_control_file
| `Io_misc of Io.misc_error
| `Closed
| `Rw_not_allowed
| `Unknown_major_pack_version of string
]
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.
val set_payload :
t ->
Irmin_pack_unix__.Control_file_intf.Payload_v3.t ->
(unit, [> Io.write_error ]) result
RW mode
Write a new payload on disk.
RO mode
Always returns an error.
RW mode
Tell the OS to fush its internal buffers.
RO mode
Always returns Error `Ro_not_allowed
.