| 46 | } |
| 47 | |
| 48 | static void ls_all(acl::scan_dir& scan, const char* path, bool recursive, |
| 49 | bool fullpath) |
| 50 | { |
| 51 | if (scan.open(path, recursive) == false) { |
| 52 | logger_error("open path: %s error: %s", |
| 53 | path, acl::last_serror()); |
| 54 | return; |
| 55 | } |
| 56 | |
| 57 | int ndirs = 0, nfiles = 0; |
| 58 | const char* name; |
| 59 | bool is_file; |
| 60 | |
| 61 | while ((name = scan.next(fullpath, &is_file)) != NULL) { |
| 62 | logger("%s: %s, path: %s", is_file ? "filename" : "dirname", |
| 63 | name, scan.curr_path()); |
| 64 | if (is_file) |
| 65 | nfiles++; |
| 66 | else |
| 67 | ndirs++; |
| 68 | } |
| 69 | |
| 70 | logger("==========================================================="); |
| 71 | logger("total dir count: %d, file count: %d", ndirs, nfiles); |
| 72 | } |
| 73 | |
| 74 | static bool get_relative_path(const char* spath, const char* filepath, |
| 75 | acl::string& rpath) |
no test coverage detected
searching dependent graphs…