#elif defined(__OS2__)
return (::DosDeleteDir((PSZ)dir.c_str()) == 0);
#elif defined(__WXWINCE__)
- return (CreateDirectory(dir, NULL) != 0);
+ return (RemoveDirectory(dir) != 0);
#elif defined(__WXPALMOS__)
// TODO with VFSFileRename()
return false;
}
// does the path exists? (may have or not '/' or '\\' at the end)
-bool wxDirExists(const wxChar *pszPathName)
+bool wxDirExists(const wxString& pathName)
{
- wxString strPath(pszPathName);
+ wxString strPath(pathName);
#if defined(__WINDOWS__) || defined(__OS2__)
// Windows fails to find directory named "c:\dir\" even if "c:\dir" exists,
return wxStat(strPath.c_str(), &st) == 0 && ((st.st_mode & S_IFMT) == S_IFDIR);
#else
// S_IFMT not supported in VA compilers.. st_mode is a 2byte value only
- return wxStat(pszPathName, &st) == 0 && (st.st_mode == S_IFDIR);
+ return wxStat(strPath.c_str(), &st) == 0 && (st.st_mode == S_IFDIR);
#endif
#endif // __WIN32__/!__WIN32__
bool wxSetWorkingDirectory(const wxString& d)
{
#if defined(__OS2__)
+ if (d[1] == ':')
+ {
+ ::DosSetDefaultDisk(1 + wxToupper(d[0]) - _T('A'));
+ // do not call DosSetCurrentDir when just changing drive,
+ // since it requires e.g. "d:." instead of "d:"!
+ if (d.length() == 2)
+ return true;
+ }
return (::DosSetCurrentDir((PSZ)d.c_str()) == 0);
#elif defined(__UNIX__) || defined(__WXMAC__) || defined(__DOS__)
return (chdir(wxFNSTRINGCAST d.fn_str()) == 0);