MCPcopy Create free account
hub / github.com/Icinga/icinga2 / MkDirP

Method MkDirP

lib/base/utility.cpp:694–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

692}
693
694void Utility::MkDirP(const String& path, int mode)
695{
696 size_t pos = 0;
697
698 while (pos != String::NPos) {
699#ifndef _WIN32
700 pos = path.Find("/", pos + 1);
701#else /*_ WIN32 */
702 pos = path.FindFirstOf("/\\", pos + 1);
703#endif /* _WIN32 */
704
705 String spath = path.SubStr(0, pos + 1);
706 struct stat statbuf;
707 if (stat(spath.CStr(), &statbuf) < 0 && errno == ENOENT)
708 MkDir(path.SubStr(0, pos), mode);
709 }
710}
711
712void Utility::Remove(const String& path)
713{

Callers

nothing calls this directly

Calls 6

MkDirFunction · 0.85
FindMethod · 0.80
FindFirstOfMethod · 0.80
SubStrMethod · 0.80
CStrMethod · 0.80
statClass · 0.70

Tested by

no test coverage detected