MCPcopy Create free account
hub / github.com/AGWA/git-crypt / mkdir_parent

Function mkdir_parent

util-win32.cpp:96–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void mkdir_parent (const std::string& path)
97{
98 std::string::size_type slash(path.find('/', 1));
99 while (slash != std::string::npos) {
100 std::string prefix(path.substr(0, slash));
101 if (GetFileAttributes(prefix.c_str()) == INVALID_FILE_ATTRIBUTES) {
102 // prefix does not exist, so try to create it
103 if (!CreateDirectory(prefix.c_str(), nullptr)) {
104 throw System_error("CreateDirectory", prefix, GetLastError());
105 }
106 }
107
108 slash = path.find('/', slash + 1);
109 }
110}
111
112std::string our_exe_path ()
113{

Callers

nothing calls this directly

Calls 1

System_errorClass · 0.85

Tested by

no test coverage detected