Mavryk_store_unix.Block_repr_unix
Unix-dependent accessors for Block_repr
.
val read_next_block_exn :
Lwt_unix.file_descr ->
(Mavryk_store_shared.Block_repr.t * int) Lwt.t
read_next_block_exn fd
reads from fd
and decode the next block found in the descriptor. The fd
's offset is moved as a side effect. This returns the decoded block along with the block length (number of bytes) of the encoded block. This function updates the given fd
state and may raise Unix.error errors, see Unix.read.
val read_next_block :
Lwt_unix.file_descr ->
(Mavryk_store_shared.Block_repr.t * int) option Lwt.t
Same as read_next_block fd
but returns None
if there was an error.
val pread_block_exn :
Lwt_unix.file_descr ->
file_offset:int ->
(Mavryk_store_shared.Block_repr.t * int) Lwt.t
pread_block_exn fd ~file_offset
reads from fd
and decode the block at offset file_offset
in the descriptor. This returns the decoded block along with the block length (number of bytes) of the encoded block. This function may raise Unix.error errors, see Unix.read.
val pread_block :
Lwt_unix.file_descr ->
file_offset:int ->
(Mavryk_store_shared.Block_repr.t * int) option Lwt.t
Same as pread_block fd ~file_offset
but returns None
if there was an error.