#endif
#ifndef WX_PRECOMP
-#include "wx/intl.h"
-#include "wx/log.h"
-#include "wx/file.h"
+ #include "wx/dynarray.h"
+ #include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/file.h"
+ #include "wx/utils.h"
#endif
#include "wx/filename.h"
#include "wx/tokenzr.h"
#include "wx/config.h" // for wxExpandEnvVars
-#include "wx/utils.h"
#include "wx/file.h"
#include "wx/dynlib.h"
bool wxFileName::DirExists() const
{
- return wxFileName::DirExists( GetFullPath() );
+ return wxFileName::DirExists( GetPath() );
}
bool wxFileName::DirExists( const wxString &dir )
bool wxFileName::SetCwd()
{
- return wxFileName::SetCwd( GetFullPath() );
+ return wxFileName::SetCwd( GetPath() );
}
bool wxFileName::SetCwd( const wxString &cwd )
// 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("\\") + name;
int i = 1;
#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
bool wxFileName::Mkdir( int perm, int flags )
{
- return wxFileName::Mkdir( GetFullPath(), perm, flags );
+ return wxFileName::Mkdir(GetPath(), perm, flags);
}
bool wxFileName::Mkdir( const wxString& dir, int perm, int flags )
bool wxFileName::Rmdir()
{
- return wxFileName::Rmdir( GetFullPath() );
+ return wxFileName::Rmdir( GetPath() );
}
bool wxFileName::Rmdir( const wxString &dir )
}
/* 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 */
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 )
{
OSType m_creator ;
} ;
-#include "wx/dynarray.h"
WX_DECLARE_OBJARRAY(MacDefaultExtensionRecord, MacDefaultExtensionArray) ;
bool gMacDefaultExtensionsInited = false ;