X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..d6ddcd574bce0167851aef142be1f9722c694654:/src/common/wfstream.cpp?ds=inline diff --git a/src/common/wfstream.cpp b/src/common/wfstream.cpp index b28617d537..3605e2a707 100644 --- a/src/common/wfstream.cpp +++ b/src/common/wfstream.cpp @@ -103,6 +103,16 @@ wxFileOutputStream::wxFileOutputStream(const wxString& fileName) { m_file = new wxFile(fileName, wxFile::write); m_file_destroy = TRUE; + + if (!m_file->IsOpened()) + { + m_lasterror = wxSTREAM_WRITE_ERROR; + } + else + { + if (m_file->Error()) + m_lasterror = wxSTREAM_WRITE_ERROR; + } } wxFileOutputStream::wxFileOutputStream(wxFile& file) @@ -250,6 +260,16 @@ wxFFileOutputStream::wxFFileOutputStream(const wxString& fileName) { m_file = new wxFFile(fileName, "w+b"); m_file_destroy = TRUE; + + if (!m_file->IsOpened()) + { + m_lasterror = wxSTREAM_WRITE_ERROR; + } + else + { + if (m_file->Error()) + m_lasterror = wxSTREAM_WRITE_ERROR; + } } wxFFileOutputStream::wxFFileOutputStream(wxFFile& file)