X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..08c4a8a9dd5d6f50a99aeca0999c7ae682ae76e5:/src/common/wfstream.cpp 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)