tjac
tjac

Reputation: 822

Windows C: the inverse of CreateMapFile

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

Answers (1)

Jerry Coffin
Jerry Coffin

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

Related Questions