FileMapping.this

Open filename and map it in memory. If Datum is const, opens for read-only and maps the content in memory; no error is issued if the file does not exist. This makes it easy to treat a non-existing file as empty.

If Datum is mutable, opens for read/write (creates file if it does not exist) and fails fatally on any error.

Due to quirks in mmap, if the file is empty, handle is valid but data is null. This state is valid and accounted for.

struct FileMapping(Datum)
nothrow
this
(
const char* filename
)

Parameters

filename char*

the name of the file to be mapped in memory

Meta