Processing a file as memory (and allowing the OS to make an IO file for you) is called memory mapping .
On POSIX (like Linux ), the mmap() function does this.
On Windows , the OpenFileMapping() function and friends do this. Microsoft has a great description of how this works, why use it, and details on their platform here .
source share