Set the file name for temporary wxFFile objects.
Pass the name of the temporary file to wxFFile::Attach(). This allows to give more useful error messages if any operation on this file fails later. Closes #13903. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -805,7 +805,7 @@ static bool wxTempOpen(wxFFile *file, const wxString& path, bool *deleteOnClose)
|
||||
int fd = wxTempOpen(path, deleteOnClose);
|
||||
if (fd == -1)
|
||||
return false;
|
||||
file->Attach(wx_fdopen(fd, "w+b"));
|
||||
file->Attach(wx_fdopen(fd, "w+b"), path);
|
||||
return file->IsOpened();
|
||||
#endif // wx_fdopen
|
||||
}
|
||||
@@ -916,7 +916,7 @@ static wxString wxCreateTempImpl(
|
||||
if ( ffileTemp )
|
||||
{
|
||||
#ifdef wx_fdopen
|
||||
ffileTemp->Attach(wx_fdopen(fdTemp, "r+b"));
|
||||
ffileTemp->Attach(wx_fdopen(fdTemp, "r+b"), path);
|
||||
#else
|
||||
ffileTemp->Open(path, wxT("r+b"));
|
||||
close(fdTemp);
|
||||
|
||||
Reference in New Issue
Block a user