| 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 | { |
nothing calls this directly
no test coverage detected