wxMkDir() has 'perm' argument
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -161,10 +161,13 @@ with wildcard characters. See \helpref{wxIsWild}{wxiswild}.
|
||||
|
||||
\membersection{::wxMkdir}
|
||||
|
||||
\func{bool}{wxMkdir}{\param{const wxString\& }{dir}}
|
||||
\func{bool}{wxMkdir}{\param{const wxString\& }{dir}, \param{int }{perm = 0777}}
|
||||
|
||||
Makes the directory {\it dir}, returning TRUE if successful.
|
||||
|
||||
{\it perm} is the access mask for the directory for the systems on which it is
|
||||
supported (Unix) and doesn't have effect for the other ones.
|
||||
|
||||
\membersection{::wxRemoveFile}
|
||||
|
||||
\func{bool}{wxRemoveFile}{\param{const wxString\& }{file}}
|
||||
|
@@ -153,7 +153,7 @@ WXDLLEXPORT wxString wxGetCwd();
|
||||
WXDLLEXPORT bool wxSetWorkingDirectory(const wxString& d);
|
||||
|
||||
// Make directory
|
||||
WXDLLEXPORT bool wxMkdir(const wxString& dir);
|
||||
WXDLLEXPORT bool wxMkdir(const wxString& dir, int perm = 0777);
|
||||
|
||||
// Remove directory. Flags reserved for future use.
|
||||
WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
|
||||
|
@@ -980,21 +980,24 @@ 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__)
|
||||
return FALSE;
|
||||
#elif defined( __WXMAC__ )
|
||||
#if 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);
|
||||
const char *dirname = gwxMacFileName;
|
||||
#else
|
||||
return (mkdir(WXSTRINGCAST dir) == 0);
|
||||
const char *dirname = dir.c_str();
|
||||
#endif
|
||||
|
||||
if ( mkdir(dirname, perm) != 0 )
|
||||
{
|
||||
wxLogSysError(_("Directory '%s' couldn't be created"), dirname);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxRmdir(const wxString& dir, int WXUNUSED(flags))
|
||||
|
Reference in New Issue
Block a user