biohazard-2.1: bioinformatics support library
Safe HaskellNone




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.