biohazard-2.1: bioinformatics support library

Safe HaskellNone
LanguageHaskell2010

Bio.Util.MMap

Synopsis

Documentation

mmapFile :: FilePath -> IO (Int, ForeignPtr a) Source #

Maps a whole file into memory, returns the size in bytes and a ForeignPtr to the contents.

createMmapFile :: FilePath -> CSize -> (Ptr a -> IO (Ptr a, b)) -> IO b Source #

Creates a new file of a desired initial size, maps it into memory, and calls a function to fill it. That function returns a pointer to the first unused byte in the file, and it is truncated accordingly.