[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: os.tmpname makes empty file
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 24 Feb 2008 09:22:46 -0300
> Looking at how mkstemp is used in luaconf.h
> is it any safer than using tmpnam?
>
> I get the feeling that the problem is in the tmpname
> API, and that cannot really be fixed. A better API
> should be added.
As far as I understand it is safe. The API of mkstemp is not the same
as that of tmpnam, because the former creates the file toghether
with the name (as a side effect). Once the file is created with the
right permissions, when you open the file later it keeps the right
permissions.
-- Roberto