package irmin-pack

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

Install

Dune Dependency

Authors

Maintainers

Sources

irmin-3.11.0.tbz
sha256=09996fbcc2c43e117a9bd8e9028c635e81cccb264d5e02d425ab8b06bbacdbdb
sha512=0391a6bf7b94a1edd50a3a8df9e58961739fa78d7d689d61f56bc87144483bad2ee539df595c33d9d52c29b3458da5dddf3a73b5eb85e49c4667c26d2cd46be1

doc/irmin-pack.unix/Irmin_pack_unix/Lower/Make_volume/Sparse/Wo/index.html

Module Sparse.WoSource

Sourcetype t
Sourceval open_wo : mapping_size:int -> mapping:string -> data:string -> (t, [> open_error ]) result

open_wo ~mapping_size ~mapping ~data returns a write-only instance of the sparse file.

Note: This is unsafe and is only used by the GC to mark the parent commits as dangling. One must ensure that no read-only instance is opened at the same time, as otherwise the writes would be observable by it.

Sourceval write_exn : t -> off:Optint.Int63.t -> len:int -> string -> unit

write_exn t ~off ~len str writes the first len bytes of str to t at the virtual offset off.

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

fsync t persists to the file system the effects of previous writes.

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

Close the underlying files.

Sourceval create_from_data : mapping:string -> dead_header_size:int -> size:Optint.Int63.t -> data:string -> (Optint.Int63.t, [> Io.create_error | Io.write_error | Io.close_error ]) result

create_from_data ~mapping ~dead_header_size ~size ~data initializes a new sparse file on disk from the existing file data, by creating the corresponding mapping file. The first dead_header_size bytes are ignored and the remaining size bytes of data are made available.

On success, returns the size of the mapping file to be stored in the control file for consistency checking on open.

OCaml

Innovation. Community. Security.