vector-mmap-0.0.1: Memory map immutable and mutable vectors

Data.Vector.Storable.MMap

Synopsis

Documentation

data Mode

Mode of mapping. Four cases are supported.

Constructors

ReadOnly

file is mapped read-only, file must exist

ReadWrite

file is mapped read-write, file must exist

WriteCopy

file is mapped read-write, but changes aren't propagated to disk, file must exist

ReadWriteEx

file is mapped read-write, if file does not exist it will be created with default permissions, region parameter specifies size, if file size is lower it will be extended with zeros

unsafeMMapMVectorSource

Arguments

:: forall s a . Storable a 
=> FilePath

Path of the file to map

-> Mode

Mapping mode

-> Maybe (Int64, Int)

Nothing to map entire file into memory, otherwise 'Just (fileOffset, elementCount)'

-> IO (MVector (PrimState IO) a) 

Map a file into memory as a mutable vector.

unsafeMMapVectorSource

Arguments

:: forall a . Storable a 
=> FilePath

Path of the file to map

-> Maybe (Int64, Int)

Nothing to map entire file into memory, otherwise 'Just (fileOffset, elementCount)'

-> IO (Vector a) 

Map a file into memory (ReadOnly mode) as an immutable vector.