D
Language
Phobos
Comparisons
object
std
std.base64
std.boxer
std.compiler
std.conv
std.cover
std.ctype
std.date
std.demangle
std.file
std.format
std.gc
std.intrinsic
std.math
std.md5
std.mmfile
std.openrj
std.outbuffer
std.path
std.process
std.random
std.regexp
std.socket
std.socketstream
std.stdint
std.stdio
std.cstream
std.stream
std.string
std.system
std.thread
std.uni
std.uri
std.utf
std.zip
std.zlib
std.c.fenv
std.c.math
std.c.process
std.c.stdarg
std.c.stddef
std.c.stdio
std.c.stdlib
std.c.string
std.c.time
std.c.wcharh
std.windows.charset
std.windows
std.linux
std.c.windows
std.c.linux
|
std.mmfile
Read and write memory mapped files.
- class MmFile;
- MmFile objects control the memory mapped file resource.
- enum Mode;
- The mode the memory mapped file is opened with.
- Read
- read existing file
- ReadWriteNew
- delete existing file, write new file
- ReadWrite
- read/write existing file, create if not existing
- ReadCopyOnWrite
- read/write existing file, copy on write
- this(char[] filename);
- Open memory mapped file filename for reading.
File is closed when the object instance is deleted.
Throws:
std.file.FileException
- this(char[] filename, Mode mode, ulong size, void* address, uint window = cast(uint)0);
- Open memory mapped file filename in mode.
File is closed when the object instance is deleted.
Params:
char[] filename |
name of the file.
If null, an anonymous file mapping is created. |
Mode mode |
access mode defined above. |
ulong size |
the size of the file. If 0, it is taken to be the
size of the existing file. |
void* address |
the preferred address to map the file to,
although the system is not required to honor it.
If null, the system selects the most convenient address. |
uint window |
preferred block size of the amount of data to map at one time
with 0 meaning map the entire file. The window size must be a
multiple of the memory allocation page size. |
Throws:
std.file.FileException
- ulong length();
- Gives size in bytes of the memory mapped file.
- Mode mode();
- Read-only property returning the file mode.
- void[] opSlice();
- Returns entire file contents as an array.
- void[] opSlice(ulong i1, ulong i2);
- Returns slice of file contents as an array.
- ubyte opIndex(ulong i);
- Returns byte at index i in file.
- ubyte opIndexAssign(ubyte value, ulong i);
- Sets and returns byte at index i in file to value.
|