package irmin-pack
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=6aa5ba4c6a0233747d4bd3ab396f2b3a33bb80f9d8ed4a178c83a035033c0e52
sha512=8a5506a57e8569a11c883ca25b3c60ae7a9a03c2da111668193d7b4296434c43f1a310e78f189e4b38c234da790259d2961c6a0ae481282c18bb97f618fccfb6
doc/irmin-pack.unix/Irmin_pack_unix/File_manager/Make/Sparse/Wo/index.html
Module Sparse.Wo
Source
val 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.
write_exn t ~off ~len str
writes the first len
bytes of str
to t
at the virtual offset off
.
fsync t
persists to the file system the effects of previous writes.
Close the underlying files.
val 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.