help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mkstemp() and fstream() with g++ 3.2.3/libstdc++-3.2.3 / WBL3.0


From: Robert Heller
Subject: mkstemp() and fstream() with g++ 3.2.3/libstdc++-3.2.3 / WBL3.0
Date: Sat, 05 Nov 2005 05:35:00 +0100

I need to create a unique temporary file and use it with C++ streams. 
With older C++ libraries under Linux (RH 7.3/G++ 2.96/libstdc++-2.96), I
could use mkstemp() to create and open file and then make it a stream by
passing the fd to fstream(). The newer iostream library does not seem to
have this conversion available.  I could use one of the other temp file
creation function, by they all say 'don't use this function, it is a
security risk, use mkstemp() instead'.  So, how do I deal with this? 
Not use C++ iostreams?  Write insecure code? Write my own fstream class
that is layered on top of file descriptors (yech!).


                                     \/
Robert Heller                        ||InterNet:   heller@cs.umass.edu
http://vis-www.cs.umass.edu/~heller  ||            heller@deepsoft.com
http://www.deepsoft.com              /\FidoNet:    1:321/153






                                                                             


reply via email to

[Prev in Thread] Current Thread [Next in Thread]