X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e541d0bf0cc45b77ca30e2ade5745dfe36341d09..58a33cb4e6e2de9d6ea6da16b52e53d840797059:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 2d6085250c..e90945a676 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -785,7 +785,7 @@ wxMac2UnixFilename (char *s) if (*s == ':') *s = '/'; else - *s = wxToLower (*s); // Case INDEPENDENT + *s = tolower(*s); // Case INDEPENDENT s++; } } @@ -830,7 +830,7 @@ wxDos2UnixFilename (char *s) *s = '/'; #ifdef __WXMSW__ else - *s = wxToLower (*s); // Case INDEPENDENT + *s = tolower(*s); // Case INDEPENDENT #endif s++; } @@ -980,21 +980,30 @@ bool wxRemoveFile(const wxString& file) 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))