{
// if bOverwrite we create a new file or truncate the existing one,
// otherwise we only create the new file and fail if it already exists
- int fd = open(szFileName, O_CREAT | (bOverwrite ? O_TRUNC : O_EXCL), access);
+ int fd = open(szFileName, O_WRONLY | O_CREAT |
+ (bOverwrite ? O_TRUNC : O_EXCL), access);
if ( fd == -1 ) {
wxLogSysError(_("can't create file '%s'"), szFileName);
// retrieve text and save it
// -------------------------
-#ifdef __WXGTK__
- // @@@@ TODO: no GetNumberOfLines and GetLineText in wxGTK yet
- wxLogError(_("Sorry, this function is not implemented under GTK"));
-#else
int nLines = m_pTextCtrl->GetNumberOfLines();
for ( int nLine = 0; bOk && nLine < nLines; nLine++ ) {
bOk = file.Write(m_pTextCtrl->GetLineText(nLine) + wxTextFile::GetEOL());
}
-#endif //GTK
if ( bOk )
bOk = file.Close();
if ( !bOk ) {
wxLogError(_("Can't save log contents to file."));
- return;
+ }
+ else {
+ wxLogStatus(this, _("Log saved to the file '%s'."), szFileName);
}
}