I have a rather odd program where I need to load a file into memory, close that file handle, and then use the file image in memory like a file (where i use ReadFile, WriteFile with a HANDLE)… so basically I’m looking at doing the inverse of CreateMapFile… is this possible within the Windows API?
Thanks!
When you call
CreateFile, you can useFILE_ATTRIBUTE_TEMPORARY. This attempts to hold the data for the file in RAM if possible, but it does not guarantee it — the data could be written out to disk if memory gets low enough.