FILE* and fstream

FILE* and fstream

Post by thePoe » Sat, 10 Apr 2004 06:42:57


I have an fstream that I manipulate quite heavily. Now I have a need to
rewind it and pass it into a third party C library that accepts FILE*.
The trick is that the fstream may be pointing to a real file on disk or
to a file that only exists in memory. If it was just the version of the
file on disk, I'd just close the fstream and open a FILE* handle, but
I'm not sure what to do in the case of a file that only exists in memory (
sometime we need to do some of the work without havingg a lcoation to
create a disk cache in). Any ideas that don't require disk caching the
data?

Thanks,

Jared