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

Function ls_dir

lib_acl_cpp/samples/scan_dir/main.cpp:28–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28static void ls_dir(acl::scan_dir& scan, const char* path, bool recursive,
29 bool fullpath)
30{
31 if (scan.open(path, recursive) == false) {
32 logger_error("open path: %s error: %s", path, acl::last_serror());
33 return;
34 }
35
36 int ndirs = 0;
37 const char* dirname;
38
39 while ((dirname = scan.next_dir(fullpath)) != NULL) {
40 logger("dirname: %s, path: %s", dirname, scan.curr_path());
41 ndirs++;
42 }
43
44 logger("===========================================================");
45 logger("total dir count: %d", ndirs);
46}
47
48static void ls_all(acl::scan_dir& scan, const char* path, bool recursive,
49 bool fullpath)

Callers 1

mainFunction · 0.85

Calls 4

next_dirMethod · 0.80
curr_pathMethod · 0.80
last_serrorFunction · 0.50
openMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…