Memory-mapped I/O uses the filesystem to establish a virtual memory mapping from user space directly to the applicable filesystem pages. With a memory-mapped file, we can pretend that the entire file is in memory and that we can access it by simply treating it as a very large array.
C++ Memory Mapped File Example Linux
I have an image in D Drive like 'D:Image1.tiff'. I want to read this file and write it in an another location, for example in the path 'D:Project'. How to do this using Memory Mapped File?
thevanthevan2 Answers
The CreateFromFile methods create a memory-mapped file from an existing file on disk.The following example creates a memory-mapped view of a part of an extremely large file and manipulates a portion of it.
The following example opens the same memory-mapped file for another process.
You can also read more at :http://www.codeproject.com/Articles/138290/Programming-Memory-Mapped-Files-with-the-NET-Frame
Anant DabhiWindows Memory Mapped File Example
Anant DabhiI can now achieve reading and writing a file using Memory Mapped File using the below coding:
thevanthevan