+ bool makeDirectory(const string &path);

This commit is contained in:
kelson42 2011-11-01 10:57:51 +00:00
parent cfa00c33f2
commit f2280a6b02
2 changed files with 6 additions and 0 deletions

View File

@ -93,3 +93,8 @@ bool fileExists(const string &path) {
fin.close();
return flag;
}
bool makeDirectory(const string &path) {
int status = mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
return status == 0;
}

View File

@ -38,5 +38,6 @@ string removeLastPathElement(const string path, const bool removePreSeparator =
unsigned int getFileSize(const string &path);
string getFileSizeAsString(const string &path);
bool fileExists(const string &path);
bool makeDirectory(const string &path);
#endif