package irmin-pack
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=92a9de7a0a2a35c2feba0c35a806b1f0df24c1c0d15164eebf3f919296d26715
sha512=0203ec5117a851ad5afeb2f9091659b4e142e231b6b945caab93f4d7beb23397c8ac43f7056e91d18f4bff0be1062f6ae966d221f877c229328c0cbbf29fd9f0
doc/irmin-pack.unix/Irmin_pack_unix/Control_file/Upper/index.html
Module Control_file.UpperSource
Abstraction for an irmin-pack 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 ->
tmp_path:string option ->
overwrite:bool ->
Irmin_pack_unix__.Control_file_intf.Payload.Upper.V5.t ->
(t, [> Io.create_error | Io.write_error ]) resultCreate a rw instance of t by creating a control file.
val open_ :
path:string ->
tmp_path:string option ->
readonly:bool ->
(t,
[> `Corrupted_control_file of string
| `Io_misc of Io.misc_error
| `No_such_file_or_directory of string
| `Not_a_file
| `Closed
| `Unknown_major_pack_version of string ])
resultCreate a rw instance of t by reading an existing file at path. tmp_path will be used by RW instances when updating it's content, it is not required for RO instances or RW instances which will never be updated.
val read_payload :
path:string ->
(Irmin_pack_unix__.Control_file_intf.Payload.Upper.V5.t,
[> `Corrupted_control_file of string
| `Io_misc of Io.misc_error
| `No_such_file_or_directory of string
| `Not_a_file
| `Closed
| `Unknown_major_pack_version of string
| Io.close_error ])
resultval read_raw_payload :
path:string ->
(Irmin_pack_unix__.Control_file_intf.Payload.Upper.raw_payload,
[> `Corrupted_control_file of string
| `Io_misc of Io.misc_error
| `No_such_file_or_directory of string
| `Not_a_file
| `Closed
| `Unknown_major_pack_version of string
| Io.close_error ])
resultpayload 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.
val reload :
t ->
(unit,
[> `Rw_not_allowed
| `Corrupted_control_file of string
| `Io_misc of Io.misc_error
| `No_such_file_or_directory of string
| `Not_a_file
| `Closed
| `Unknown_major_pack_version of string
| Io.close_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.Upper.V5.t ->
(unit,
[> `No_tmp_path_provided
| Io.create_error
| Io.write_error
| `Sys_error of string
| Io.close_error ])
resultRW 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.