
Thread
2011.01.11 00:01 "Re: [Tiff] Missing mkstemp() on Visual Studio 2008", by Igor Skochinsky
Hello Edward,
Monday, January 10, 2011, 10:30:34 PM, you wrote:
On 1/10/2011 3:54 PM, Bob Friesenhahn wrote:
> While I have not looked at the code, the main problem with tmpfile() is
>> that it is not a secure function.
On Windows, one can use tmpfile_s().
Do NOT use tmpfile() ('secure' or not). Due to the DOS legacy, it tries to create the file in the root directory of the current drive, which fails for C:\ under non-admin user on Vista and later. Use instead tmpnam() followed by fopen() with mode "w+bTD" (write, binary, temporary, delete on close).
--
WBR,
Igor mailto:skochinsky@mail.ru