Plasma GitLab Archive
Projects Blog Knowledge

Module Dn_store


module Dn_store: sig .. end
The directory containing the store. There are two files:
  • config: first line contains the identity string. Second line contains the block size
  • data: one big file with the data blocks


class type dn_store_config = object .. end
val init_store : dn_store_config -> string -> int64 -> unit
init_dn_store config identity size: Initializes the store. The directory must already exist. The files config and data must not exist.
type dn_store 
val open_store : dn_store_config -> dn_store
Opens the store
val close_store : dn_store -> unit
Closes the store
val get_identity : dn_store -> string
Returns the identity string
val get_blocksize : dn_store -> int
Returns the block size
val get_size : dn_store -> int64
Returns the number of blocks
val read_block : dn_store -> int64 -> int -> Netsys_mem.memory -> int -> int -> unit
read_block st block blockpos mem mpos len: Reads the bytes blockpos to blockpos+len-1 from block into the range mpos to mpos+len-1 of mem.
val write_block : dn_store -> int64 -> Netsys_mem.memory -> int -> unit
write_block st block blockpos mem mpos: Writes a complete block out. The block data are in mem from byte position mpos to mpos+blocksize-1. The data is written into block.
val sync : dn_store -> unit
Syncs the store to disk
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml