Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost filesystem get_temporary_file()
From: Mickael Wolff (mickael_at_[hidden])
Date: 2009-07-18 17:51:57


Alexander Lamaison a écrit :
> I was looking for exactly such a thing just yesterday and was surprised to
> find that boost::filesystem didn't have one. Here's the function I wrote
> instead (Windows only) in case it's of any use:

   It is not so surprising. The contrary do it to me ;) On Linux, it
exists some functions that do the stuff. But the equivalents to
GetTempPath Win32 function are considered as security flaws (the man
says it !). Because of race conditions.

   So they are tmpfile and mkstemp that compute a temporaty name and
open the file. Maybe we can write a wrapper around one of them.

   But the file will be open !

-- 
Mickaël Wolff aka Lupus Michaelis
Racine <http://lupusmic.org>
Blog   <http://blog.lupusmic.org>

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net