MappedFile

Constructors

this
this(cstring path, File.Style style)

Construct a FileMap upon the given path.

Members

Functions

close
void close()

Release this mapped buffer without flushing.

flush
MappedFile flush()

Flush dirty content out to the drive.

length
long length()
map
ubyte[] map()

Return a slice representing file content as a memory-mapped array

path
istring path()
resize
ubyte[] resize(long size)

Resize the file and return the remapped content. Usage of map() is not required following this call.

Examples

void example ( )
{
    auto file = new MappedFile ("foo.map");
    auto heap = file.resize (1_000_000);
    file.close();

    auto file1 = new MappedFile ("foo1.map");
    auto heap1 = file1.resize (1_000_000);
    file1.close();
}

Meta