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

Function compare_files

lib_acl_cpp/samples/scan_dir/main.cpp:87–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static bool compare_files(const char* sfile, const char* dfile, bool ignore)
88{
89 acl::string sbuf, dbuf;
90
91 if (acl::ifstream::load(sfile, &sbuf) == false) {
92 logger_error("load sfile %s error %s", sfile, acl::last_serror());
93 return false;
94 }
95
96 if (acl::ifstream::load(dfile, &dbuf) == false) {
97 if (acl::last_error() == ENOENT && ignore)
98 return true;
99 logger_error("load dfile %s error %s", dfile, acl::last_serror());
100 return false;
101 }
102
103 return sbuf == dbuf;
104}
105
106static void diff_path(acl::scan_dir& scan, const char* spath, const char* dpath,
107 bool recursive, const char* file_types, bool show_all, bool ignore)

Callers 1

diff_pathFunction · 0.85

Calls 2

last_errorFunction · 0.85
last_serrorFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…