... I wonder where this temporary file is created.
That example i showed you prints the location of the file.
This example is more secure, but you have to specify a file name template
#include <stdlib.h>
#include <qfile.h>
int main ()
{
const char* msg = "inside temp file";
char nameTemplate[] = "/tmp/mytempfile-XXXXXX";
int file = mkstemp(nameTemplate) ;
f.open( IO_WriteOnly,file );
f.writeBlock( msg, qstrlen(msg) );
f.close();
return 0;
}
#include <stdlib.h>
#include <qfile.h>
int main ()
{
const char* msg = "inside temp file";
char nameTemplate[] = "/tmp/mytempfile-XXXXXX";
QFile f;
int file = mkstemp(nameTemplate) ;
f.open( IO_WriteOnly,file );
f.writeBlock( msg, qstrlen(msg) );
f.close();
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks