if (*s == ':')
*s = '/';
else
- *s = wxToLower (*s); // Case INDEPENDENT
+ *s = tolower(*s); // Case INDEPENDENT
s++;
}
}
*s = '/';
#ifdef __WXMSW__
else
- *s = wxToLower (*s); // Case INDEPENDENT
+ *s = tolower(*s); // Case INDEPENDENT
#endif
s++;
}
return (flag == 0) ;
}
-bool wxMkdir(const wxString& dir)
+bool wxMkdir(const wxString& dir, int perm)
{
-#if defined(__WXSTUBS__)
- return FALSE;
-#elif defined(__VMS__)
+#if defined( __WXMAC__ )
+ strcpy( gwxMacFileName , dir ) ;
+ wxUnix2MacFilename( gwxMacFileName ) ;
+ const char *dirname = gwxMacFileName;
+#else // !Mac
+ const char *dirname = dir.c_str();
+#endif // Mac/!Mac
+
+ // assume mkdir() has 2 args on non Windows platforms and on Windows too
+ // for the GNU compiler
+#if !defined(__WXMSW__) || (defined(__GNUWIN32__) && !defined(__MINGW32__))
+ if ( mkdir(dirname, perm) != 0 )
+#else // MSW
+ if ( mkdir(dirname) != 0 )
+#endif // !MSW/MSW
+ {
+ wxLogSysError(_("Directory '%s' couldn't be created"), dirname);
+
return FALSE;
-#elif defined( __WXMAC__ )
- strcpy( gwxMacFileName , dir ) ;
- wxUnix2MacFilename( gwxMacFileName ) ;
- return (mkdir(gwxMacFileName , 0 ) == 0);
-#elif (defined(__GNUWIN32__) && !defined(__MINGW32__)) || !defined(__WXMSW__)
- return (mkdir (WXSTRINGCAST dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0);
-#else
- return (mkdir(WXSTRINGCAST dir) == 0);
-#endif
+ }
+
+ return TRUE;
}
bool wxRmdir(const wxString& dir, int WXUNUSED(flags))
if ( gs_hFileStruct == INVALID_HANDLE_VALUE )
{
- wxLogSysError(_("Can not enumerate files in directory '%s'"),
- path.c_str());
-
result.Empty();
return result;