MCPcopy Create free account
hub / github.com/covscript/covscript / chmod_r

Function chmod_r

sources/system/common.cpp:139–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 }
138
139 bool chmod_r(const std::string &path_input, const std::string &mode)
140 {
141 auto dirs = cs_system_impl::split(path_input, {'/', '\\'});
142 std::string path;
143 if (path_input.size() > 0 && (path_input[0] == '/' || path_input[0] == '\\'))
144 path = cs::path_separator;
145 for (auto &dir : dirs) {
146 path += dir + cs::path_separator;
147 // DO NOT SKIP when dir is a directory
148 // directory has permissions too
149 if (!cs_system_impl::chmod_impl(path, cs_system_impl::parse_mode(mode)))
150 return false;
151 }
152 return true;
153 }
154
155 bool chmod(const std::string &path, const std::string &mode)
156 {

Callers

nothing calls this directly

Calls 4

parse_modeFunction · 0.85
sizeMethod · 0.80
splitFunction · 0.70
chmod_implFunction · 0.50

Tested by

no test coverage detected