wxRemove and wxRename takes const wxChar*, do NOT use fn_str()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7091 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ove Kaaven
2000-04-08 15:50:45 +00:00
parent da4912c332
commit 6313775835
4 changed files with 8 additions and 8 deletions

View File

@@ -541,12 +541,12 @@ bool wxTempFile::Commit()
m_file.Close(); m_file.Close();
#ifndef __WXMAC__ #ifndef __WXMAC__
if ( wxFile::Exists(m_strName) && wxRemove(m_strName.fn_str()) != 0 ) { if ( wxFile::Exists(m_strName) && wxRemove(m_strName) != 0 ) {
wxLogSysError(_("can't remove file '%s'"), m_strName.c_str()); wxLogSysError(_("can't remove file '%s'"), m_strName.c_str());
return FALSE; return FALSE;
} }
if ( wxRename(m_strTemp.fn_str(), m_strName.fn_str()) != 0 ) { if ( wxRename(m_strTemp, m_strName) != 0 ) {
wxLogSysError(_("can't commit changes to file '%s'"), m_strName.c_str()); wxLogSysError(_("can't commit changes to file '%s'"), m_strName.c_str());
return FALSE; return FALSE;
} }
@@ -569,7 +569,7 @@ void wxTempFile::Discard()
{ {
m_file.Close(); m_file.Close();
#ifndef __WXMAC__ #ifndef __WXMAC__
if ( wxRemove(m_strTemp.fn_str()) != 0 ) if ( wxRemove(m_strTemp) != 0 )
wxLogSysError(_("can't remove temporary file '%s'"), m_strTemp.c_str()); wxLogSysError(_("can't remove temporary file '%s'"), m_strTemp.c_str());
#else #else
if ( remove( wxUnix2MacFilename(m_strTemp.fn_str())) != 0 ) if ( remove( wxUnix2MacFilename(m_strTemp.fn_str())) != 0 )

View File

@@ -881,7 +881,7 @@ bool wxFileConfig::DeleteAll()
{ {
CleanUp(); CleanUp();
if ( wxRemove(m_strLocalFile.fn_str()) == -1 ) if ( wxRemove(m_strLocalFile) == -1 )
wxLogSysError(_("can't delete user configuration file '%s'"), m_strLocalFile.c_str()); wxLogSysError(_("can't delete user configuration file '%s'"), m_strLocalFile.c_str());
m_strLocalFile = m_strGlobalFile = wxT(""); m_strLocalFile = m_strGlobalFile = wxT("");

View File

@@ -230,7 +230,7 @@ bool wxResourceTable::ParseResourceFile(const wxString& filename)
#ifdef __WXMAC__ #ifdef __WXMAC__
FILE *fd = fopen(wxUnix2MacFilename(filename.fn_str()), "r"); FILE *fd = fopen(wxUnix2MacFilename(filename.fn_str()), "r");
#else #else
FILE *fd = wxFopen(filename.fn_str(), _T("r")); FILE *fd = wxFopen(filename, _T("r"));
#endif #endif
if (!fd) if (!fd)
return FALSE; return FALSE;
@@ -2779,7 +2779,7 @@ bool wxResourceParseIncludeFile(const wxString& f, wxResourceTable *table)
if (!table) if (!table)
table = wxDefaultResourceTable; table = wxDefaultResourceTable;
FILE *fd = wxFopen(f.fn_str(), _T("r")); FILE *fd = wxFopen(f, _T("r"));
if (!fd) if (!fd)
{ {
return FALSE; return FALSE;

View File

@@ -992,7 +992,7 @@ bool wxExprDatabase::Read(const wxString& filename)
{ {
noErrors = 0; noErrors = 0;
FILE *f = wxFopen(filename.fn_str(), _T("r")); FILE *f = wxFopen(filename, _T("r"));
if (f) if (f)
{ {
thewxExprDatabase = this; thewxExprDatabase = this;
@@ -1024,7 +1024,7 @@ bool wxExprDatabase::ReadFromString(const wxString& buffer)
bool wxExprDatabase::Write(const wxString& fileName) bool wxExprDatabase::Write(const wxString& fileName)
{ {
FILE *stream = wxFopen( fileName.fn_str(), _T("w+")); FILE *stream = wxFopen( fileName, _T("w+"));
if (!stream) if (!stream)
return FALSE; return FALSE;