module Mmap:Accessing memory-mapped files as strings.sig..end
This module allows one to map files into memory and access
them byte by byte, or by extracing or blitting substrings.
type t
val map : ?write:bool ->
?copy:bool -> ?offset:int64 -> ?length:int64 -> Unix.file_descr -> tmap fd copy offset length maps the bytes offset .. offset + length - 1 of file fd;
if copy is true, the file is mapped in copy-on-write mode.val unmap : t -> unitunmap mp removes the mapping mp ; all subsequent calls with mp will raise an Invalid_argument
exception.val sub : t -> int64 -> int -> stringsub mp o n copies the bytes from offset + o to offset + o + n
into a new stringval length : t -> int64val offset : t -> int64val blit : t -> int64 -> string -> int -> int -> unitblit mp i u j n copies the bytes
j to j + n - 1 of the string u
into the bytes offset + i to offset + i + n - 1 of the map.val paste : t -> int64 -> string -> unitpaste mp i u copies the string u into the bytes offset + i to offset + i + n - 1
of the map, where n is the length of the string u.