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

Function ls_file

lib_acl_cpp/samples/scan_dir/main.cpp:7–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "acl_cpp/lib_acl.hpp"
6
7static void ls_file(acl::scan_dir& scan, const char* path, bool recursive,
8 bool fullpath)
9{
10 if (scan.open(path, recursive) == false) {
11 logger_error("open path: %s error: %s",
12 path, acl::last_serror());
13 return;
14 }
15
16 int nfiles = 0;
17 const char* filename;
18
19 while ((filename = scan.next_file(fullpath)) != NULL) {
20 logger("filename: %s, path: %s", filename, scan.curr_path());
21 nfiles++;
22 }
23
24 logger("===========================================================");
25 logger("total file count: %d", nfiles);
26}
27
28static void ls_dir(acl::scan_dir& scan, const char* path, bool recursive,
29 bool fullpath)

Callers 1

mainFunction · 0.85

Calls 4

next_fileMethod · 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…