// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "filename.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// use the directory specified by the prefix
SplitPath(prefix, &dir, &name, NULL /* extension */);
+ if (dir.empty())
+ {
+ dir = wxGetenv(_T("TMPDIR"));
+ if (dir.empty())
+ {
+ dir = wxGetenv(_T("TMP"));
+ if (dir.empty())
+ {
+ dir = wxGetenv(_T("TEMP"));
+ }
+ }
+ }
+
#if defined(__WXWINCE__)
if (dir.empty())
{
// FIXME. Create \temp dir?
- dir = wxT("\\");
+ if (DirExists(wxT("\\temp")))
+ dir = wxT("\\temp");
}
- path = dir + wxT("\\") + prefix;
+ path = dir + wxT("\\") + name;
int i = 1;
while (FileExists(path))
{
- path = dir + wxT("\\") + prefix ;
+ path = dir + wxT("\\") + name ;
path << i;
i ++;
}
#else // !Windows
if ( dir.empty() )
{
-#if defined(__WXMAC__) && !defined(__DARWIN__)
- dir = wxMacFindFolder( (short) kOnSystemDisk, kTemporaryFolderType, kCreateFolder ) ;
-#else // !Mac
- dir = wxGetenv(_T("TMP"));
- if ( dir.empty() )
- {
- dir = wxGetenv(_T("TEMP"));
- }
-
- if ( dir.empty() )
- {
- // default
- #if defined(__DOS__) || defined(__OS2__)
- dir = _T(".");
- #else
- dir = _T("/tmp");
- #endif
- }
-#endif // Mac/!Mac
+ // default
+#if defined(__DOS__) || defined(__OS2__)
+ dir = _T(".");
+#elif defined(__WXMAC__)
+ dir = wxMacFindFolder(short(kOnSystemDisk), kTemporaryFolderType, kCreateFolder);
+#else
+ dir = _T("/tmp");
+#endif
}
path = dir;
path = pathTry;
#endif // HAVE_MKTEMP/!HAVE_MKTEMP
- if ( !path.empty() )
- {
- }
#endif // HAVE_MKSTEMP/!HAVE_MKSTEMP
#endif // Windows/!Windows
}
/* static */
-wxString wxFileName::GetVolumeSeparator(wxPathFormat format)
+wxString wxFileName::GetVolumeSeparator(wxPathFormat WXUNUSED_IN_WINCE(format))
{
+#ifdef __WXWINCE__
+ return wxEmptyString;
+#else
wxString sepVol;
if ( (GetFormat(format) == wxPATH_DOS) ||
//else: leave empty
return sepVol;
+#endif
}
/* static */
}
}
#elif defined(__UNIX_LIKE__) || (defined(__DOS__) && defined(__WATCOMC__))
+ wxUnusedVar(dtCreate);
+
if ( !dtAccess && !dtMod )
{
// can't modify the creation time anyhow, don't try
return true;
}
#else // other platform
+ wxUnusedVar(dtAccess);
+ wxUnusedVar(dtMod);
+ wxUnusedVar(dtCreate);
#endif // platforms
wxLogSysError(_("Failed to modify file times for '%s'"),
return true;
}
-#elif defined(__UNIX_LIKE__) || defined(__WXMAC__) || (defined(__DOS__) && defined(__WATCOMC__))
+#elif defined(__UNIX_LIKE__) || defined(__WXMAC__) || defined(__OS2__) || (defined(__DOS__) && defined(__WATCOMC__))
wxStructStat stBuf;
if ( wxStat( GetFullPath().c_str(), &stBuf) == 0 )
{
return true;
}
#else // other platform
+ wxUnusedVar(dtAccess);
+ wxUnusedVar(dtMod);
+ wxUnusedVar(dtCreate);
#endif // platforms
wxLogSysError(_("Failed to retrieve file times for '%s'"),