fix for temp file creation under Windows
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -628,7 +628,16 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
|
|||||||
{
|
{
|
||||||
// open the file - of course, there is a race condition here, this is
|
// open the file - of course, there is a race condition here, this is
|
||||||
// why we always prefer using mkstemp()...
|
// why we always prefer using mkstemp()...
|
||||||
if ( !fileTemp->Open(path, wxFile::write_excl, wxS_IRUSR | wxS_IWUSR) )
|
//
|
||||||
|
// NB: GetTempFileName() under Windows creates the file, so using
|
||||||
|
// write_excl there would fail
|
||||||
|
if ( !fileTemp->Open(path,
|
||||||
|
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
|
||||||
|
wxFile::write,
|
||||||
|
#else
|
||||||
|
wxFile::write_excl,
|
||||||
|
#endif
|
||||||
|
wxS_IRUSR | wxS_IWUSR) )
|
||||||
{
|
{
|
||||||
// FIXME: If !ok here should we loop and try again with another
|
// FIXME: If !ok here should we loop and try again with another
|
||||||
// file name? That is the standard recourse if open(O_EXCL)
|
// file name? That is the standard recourse if open(O_EXCL)
|
||||||
|
Reference in New Issue
Block a user