Initial commit
This commit is contained in:
23
client/source/fileManip.cpp
Normal file
23
client/source/fileManip.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <fileManip.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <appConstants.hpp>
|
||||
|
||||
|
||||
bool dirExist(const std::string &path) {
|
||||
DIR* dir = opendir(path.c_str());
|
||||
if (dir) {
|
||||
closedir(dir);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool initializeStorage() {
|
||||
if (dirExist(APP_DIR)) return true;
|
||||
if (mkdir(APP_DIR, 0777) == -1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user