Add new function mkdirs

This commit is contained in:
2021-12-29 22:51:18 +08:00
parent a66c2f4bbd
commit 4618b97a2e
2 changed files with 44 additions and 0 deletions

View File

@@ -117,5 +117,13 @@ namespace fileop {
* @return true if the stream is successfully closed
*/
bool fclose(FILE* f);
/**
* @brief Creates a new directory recursively.
* @param path Path for a new directory.
* @param mode Directory permission. (Linux only)
* @param allow_exists If directory is already exists return true rather than false.
* @return true if create successfully otherwise false
*/
bool mkdirs(std::string path, int mode, bool allow_exists = false);
}
#endif