Reputation: 822
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!
Upvotes: 0
Views: 203
Reputation: 490118
When you call CreateFile
, you can use FILE_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.
Upvotes: 0