mmap

Memory mapped file access.

Summary
mmapMemory mapped file access.
Enumerations
ModeMode to use when opening a file.
Types
MemoryFileOpaque type representing a memory mapped file.
Exceptions
MmapExceptionGeneral exceptions for mmap module.
MmapException.InvalidFileAn invalid (NIL) file was used.
OpenFileExceptionAn error occured while trying to open the file.
Functions
closeClose a memory mapped file.
openOpen a memory mapped file.
readRead bytes from a memory mapped file at the given offset.
sizeReturn the size of a memory mapped file.
writeWrite bytes to a memory mapped file at the given offset.

Enumerations

Mode

Mode to use when opening a file.

Values

readread only
writeread or write

Types

MemoryFile

Opaque type representing a memory mapped file.

Exceptions

MmapException

General exceptions for mmap module.

MmapException.InvalidFile

An invalid (NIL) file was used.

OpenFileException

An error occured while trying to open the file.

Functions

close

DECLARE NATIVE FUNCTION close(INOUT f: MemoryFile)

Close a memory mapped file.

open

DECLARE NATIVE FUNCTION open(name: String,
mode: Mode): MemoryFile

Open a memory mapped file.

TODO: The only valid mode is currently Mode.read.

read

DECLARE NATIVE FUNCTION read(f: MemoryFile,
offset: Number,
count: Number): Bytes

Read bytes from a memory mapped file at the given offset.

size

DECLARE NATIVE FUNCTION size(f: MemoryFile): Number

Return the size of a memory mapped file.

write

DECLARE NATIVE FUNCTION write(f: MemoryFile,
offset: Number,
data: Bytes)

Write bytes to a memory mapped file at the given offset.

DECLARE NATIVE FUNCTION close(INOUT f: MemoryFile)
Close a memory mapped file.
DECLARE NATIVE FUNCTION open(name: String,
mode: Mode): MemoryFile
Open a memory mapped file.
DECLARE NATIVE FUNCTION read(f: MemoryFile,
offset: Number,
count: Number): Bytes
Read bytes from a memory mapped file at the given offset.
DECLARE NATIVE FUNCTION size(f: MemoryFile): Number
Return the size of a memory mapped file.
DECLARE NATIVE FUNCTION write(f: MemoryFile,
offset: Number,
data: Bytes)
Write bytes to a memory mapped file at the given offset.
Close