[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: mkstemp
- From: Christian Vogler <Christian.Vogler@...>
- Date: Sat, 15 Apr 2006 17:13:04 -0400
> > handle = mkstemp(filename)
>
> **** race condition here! If the process' umask isn't set correctly,
> another process might open the file. ****
Oops, right. You have to call umask first.
> tmpfile() is a better option; it's defined to do this stuff *for* you, so
> you don't have to, and risk getting it wrong.
Problem is that in some libraries it does not. :-(
So, what can one do?
- Christian