S
sfx1999
Guest
I have a problem. Let's say I have a string. Is there any way to make it into a FILE pointer without actually saving it?
char szBuffer[MAX_PATH];GetModuleFileName( NULL, szBuffer, MAX_PATH );FILE * pFile = fopen( "C:\\Temp.txt", "wtT" );fprintf( pFile, "The path to my executable is %s.\n", szBuffer );fclose( pFile );
Huh, where is the 'T' from ? I haven't seen it anywhere in documentation ... is it compiler independent ?The file was opened in wtT mode, which means it was created for writing, overwritten if existing, formatted for text, and temporary—not flushed to disk if possible.
CConvFile tempfile;tempfile.OpenMemory( NULL, 0, CConvFile::fm_write );tempfile.Print( "Temporary number is %i\n", number );tempfile.Write( 10, ten_bytes_of_something );// and later on when you want to read the text;tempfile.Seek( 0, SEEK_SET );tempfile.gets( text_buffer, text_buffer_size );tempfile.Read( 10, buffer_for_ten_bytes_of_something );
She's got huuuuge ...tracts of RAM!
HmmmmOK let me explain what I am trying to do. I have an image library that accepts either a file name or a FILE pointer. The problem is, I will be loading some images from ZIP files, so it would need decompressed first. Is there anyway to cast a buffer to a FILE?