package octez-internal-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/irmin_pack_unix/Irmin_pack_unix/Sparse_file/Make/Wo/index.html
Module Make.Wo
Source
val open_wo :
mapping_size:int ->
mapping:string ->
data:string ->
(t, [> open_error ]) Stdlib.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 ])
Stdlib.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.