X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..bc87fd68e39395dc3e8beb17cf8af7b38b903322:/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)