+
+wxFFileOutputStream::wxFFileOutputStream()
+ : wxOutputStream()
+{
+ m_file_destroy = false;
+ m_file = NULL;
+}
+
+wxFFileOutputStream::wxFFileOutputStream(FILE *file)
+{
+ m_file = new wxFFile(file);
+ m_file_destroy = true;
+}
+
+wxFFileOutputStream::~wxFFileOutputStream()
+{
+ if (m_file_destroy)
+ {
+ Sync();
+ delete m_file;
+ }
+}
+
+size_t wxFFileOutputStream::OnSysWrite(const void *buffer, size_t size)
+{
+ size_t ret = m_file->Write(buffer, size);
+ // It is not safe to call Error() if the file is not opened.
+ if (!m_file->IsOpened() || m_file->Error())
+ m_lasterror = wxSTREAM_WRITE_ERROR;
+ else
+ m_lasterror = wxSTREAM_NO_ERROR;
+ return ret;
+}
+
+wxFileOffset wxFFileOutputStream::OnSysTell() const
+{
+ return m_file->Tell();
+}
+
+wxFileOffset wxFFileOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
+{
+#ifdef __VMS
+#pragma message disable intsignchange
+#endif
+ return ( m_file->Seek(pos, mode) ? (wxFileOffset)m_file->Tell() : wxInvalidOffset );
+#ifdef __VMS
+#pragma message enable intsignchange
+#endif
+}
+
+void wxFFileOutputStream::Sync()
+{
+ wxOutputStream::Sync();
+ m_file->Flush();
+}
+
+wxFileOffset wxFFileOutputStream::GetLength() const
+{
+ return m_file->Length();
+}
+
+// ----------------------------------------------------------------------------
+// wxFFileStream
+// ----------------------------------------------------------------------------
+
+wxFFileStream::wxFFileStream(const wxString& fileName)
+ : wxFFileInputStream(fileName)
+{
+ wxFFileOutputStream::m_file = wxFFileInputStream::m_file;
+}
+
+#endif
+ // wxUSE_STREAMS && wxUSE_FILE
+