MCPcopy Create free account
hub / github.com/acl-dev/acl / check_dir

Function check_dir

lib_acl_cpp/samples/dircopy/main.cpp:223–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223static bool check_dir(acl::scan_dir& scan, const char* to, int* ncopied)
224{
225 const char* rpath = scan.curr_path();
226 if (rpath == NULL)
227 {
228 logger_error("get from's path error: %s, to: %s",
229 acl::last_serror(), to);
230 return false;
231 }
232
233 SKIP(rpath);
234
235 acl::string to_path;
236 to_path << to << SEP << rpath;
237
238 if (strstr(to_path.c_str(), ".svn") != NULL
239 || strstr(to_path.c_str(), ".git") != NULL
240 || strstr(to_path.c_str(), ".cvs") != NULL)
241 {
242 return true;
243 }
244
245 // printf(">>to_path: %s, to: %s\r\n", to_path.c_str(), to);
246
247 if (access(to_path.c_str(), 0) == 0)
248 return true;
249
250 int ret = acl_make_dirs(to_path.c_str(), 0755);
251 if (ret == 0)
252 {
253 (*ncopied)++;
254 return true;
255 }
256
257 logger_error("make dirs(%s) error: %s",
258 to_path.c_str(), acl::last_serror());
259 return false;
260}
261
262static void do_copy(const acl::string& from, const acl::string& to)
263{

Callers 1

do_copyFunction · 0.70

Calls 4

acl_make_dirsFunction · 0.85
curr_pathMethod · 0.80
last_serrorFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…