>>If you're not actually concerned with memory mapping, but just want an
object that can be read and written via operators >> and << without
being tied to a physical file, you might consider using a stringstream.
My concern is not operators but a library which requires a file stream
for reading and writing. Since it is a C library, I am pretty sure that
it is not using << and >> operators for reading and writing. I assume
that it uses fread and fwrite calls for reading and writing.
Also although I am writing code on Linux but I also want the same code
to run on windows with minimal changes on windows as well, hence mmap
is not suitable for me as it can map a file to stream but I don't want
at all to create a regular file, apart from mmap being system dependent
call.
I can across common cpp library on gnu, which is cross platform (*nix
and windows only) which provides a portable MappedFile class using
which one can map, unmap and sync mapped files. But again it creates a
files which is what I don't want. Also just to have a mapped file, I
don't want to link with a totally new library.
Divick