with-mapped-file ( path quot -- )
Memory-mapped files

Prev:<mapped-file> ( path -- mmap )
Next:with-mapped-file-reader ( path quot -- )


Inputs and outputs
patha pathname string
quota quotation with stack effect ( mmap -- )

Generic word contract
Opens a file for read/write access and maps its contents into memory, passing the mapped-file instance to the quotation. The mapped file is disposed of when the quotation returns, or if an error is thrown.

This is a low-level word, because mapped-file objects simply expose their base address and length. Most applications should use Working with memory-mapped data instead.

Throws an error if a memory mapping could not be established.