MCPcopy Create free account
hub / github.com/SOUI2/soui / createRecursionDir

Function createRecursionDir

components/log4z/log4z.cpp:842–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

840
841
842bool createRecursionDir(std::string path)
843{
844 if (path.length() == 0) return true;
845 std::string sub;
846 fixPath(path);
847
848 std::string::size_type pos = path.find('/');
849 while (pos != std::string::npos)
850 {
851 std::string cur = path.substr(0, pos-0);
852 if (cur.length() > 0 && !isDirectory(cur))
853 {
854 bool ret = false;
855#if defined (WIN32) || defined(_WIN64)
856 ret = CreateDirectoryA(cur.c_str(), NULL) ? true : false;
857#else
858 ret = (mkdir(cur.c_str(), S_IRWXU|S_IRWXG|S_IRWXO) == 0);
859#endif
860 if (!ret)
861 {
862 return false;
863 }
864 }
865 pos = path.find('/', pos+1);
866 }
867
868 return true;
869}
870
871unsigned int getProcessID()
872{

Callers 1

openLoggerMethod · 0.85

Calls 5

fixPathFunction · 0.85
isDirectoryFunction · 0.85
lengthMethod · 0.45
findMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected