File Mapping

Traditionally when you wanted to map a file into memory on Unix this was done using mmap and on Windows with CreateFileMapping. Continuing the tradition of simple, consistent API's, in 4.4 QFile will have two new functions: map() and unmap() that provide the ability to map files into memory.

An quick example:

QFile file("foo");;
uchar *memory =, file.size());
if (memory) {
// have some fun with the data

You can check out more in the
map and unmap documentation.

Blog Topics: