Boost logo

Boost :

From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2004-07-20 01:34:05


Le mar 20/07/2004 à 08:06, Vladimir Prus a écrit :
> Robert Ramey wrote:
> > >> [1] As does the manpage say: "Never use this function".
> > >
> > >Depending on the version, you may even see a more helpful message in the
> > >manpage.
> > >
> > >
> > >BUGS
> > > Never use this function. Use mkstemp(3) instead.
> >
> > Well, not helpful enough. Making a stream from a file descriptor is code I
> > don't have.
>
> Maybe, you should take a look at the code I've posted... you don't need to
> create fstream from file descriptor. You can open the file using the name
> mkstemp returns via the in/out parameter.

No, using mkstemp this way is no different than using tmpnam. Even if
the file is already open, there is no reason for it to still be linked
in the directory. So you may end up with a different file, and chaos
ensues.

Regards,

Guillaume


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk