How do I save a file in the RAM memory?
Posted on 2011-05-05
what is the best way to save a file in the memory RAM and to read it only while it is in the RAM. What I mean is: I need to make an application that receives a certificate from another device but I cannot store it on the local device for security reasons. So I must receive it, store it in the RAM and use it(read mode only) while it is in the RAM. If the local device crashes the file must be lost to avoid security issues .
The language I'm using is C under Linux
I think a possible solution could be to use mmap() but I'm not sure since according to what I know, mmap makes a mapping in memory of a file that exists on disk but I've never used it so I'm not sure.
Thanks in advance