help-gplusplus
[Top][All Lists]
Advanced

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

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


From: Ulrich Eckhardt
Subject: Re: mkstemp() and fstream() with g++ 3.2.3/libstdc++-3.2.3 / WBL3.0
Date: Sat, 05 Nov 2005 08:57:44 +0100
User-agent: KNode/0.8.2

Robert Heller wrote:

> 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),

http://gcc.gnu.org/gcc-2.96.html

> I could use mkstemp() to create and open file [...]

Was never standard, newer GCCs now finally moved this feature to an
extension namespace, see the docs (sorry, no, I do not have a link handy).

> 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!).

You'd write a streambuffer, not a stream, both of which is trivial though
(assuming you know how to). Get "C++ IOStreams and Locales" from Langer
and Kreft if you want to know.

Uli

-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/



reply via email to

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