P
Philipp Kraus
Hello,
how can I created a temporary (unique) file? I have used the C function
tmpnam, but my newer gcc shows a warning, that the using is dangerous.
So I would like to switch to mkstemp(), but this function is not in the
standard.
I have written a logger class which creates on a static attribute
(std::string logger::m_filename = tmpnam(NULL) the temporary
filename and if there is a log entry the file is created. My code
should be run / compile under posix- and Windows systems so how can I
create (optimal a fstream) with a temporary file, which can only read
by the owner and is not delete after the program is finished?
Thanks
Phil
how can I created a temporary (unique) file? I have used the C function
tmpnam, but my newer gcc shows a warning, that the using is dangerous.
So I would like to switch to mkstemp(), but this function is not in the
standard.
I have written a logger class which creates on a static attribute
(std::string logger::m_filename = tmpnam(NULL) the temporary
filename and if there is a log entry the file is created. My code
should be run / compile under posix- and Windows systems so how can I
create (optimal a fstream) with a temporary file, which can only read
by the owner and is not delete after the program is finished?
Thanks
Phil