MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / remove_all_old_files

Function remove_all_old_files

tools/comdb2ar/util.cpp:337–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337void remove_all_old_files(std::string &datadir) {
338 std::list<std::string> dirlist;
339 listdir_abs(dirlist, datadir);
340
341 for (std::list<std::string>::const_iterator ii = dirlist.begin(); ii != dirlist.end(); ++ii) {
342 try {
343 if (!isDirectory(*ii)) {
344 std::string s(*ii);
345 /* don't delete lrl file */
346 if (s.find(".lrl") == s.npos) {
347 std::clog << "deleted: " << s << std::endl;
348 unlink(s.c_str());
349 }
350 }
351 }
352 catch (Error &e) {
353 std::clog << "couldn't stat " << *ii << ", not removing" << std::endl;
354 }
355 }
356}
357
358bool check_usenames(const std::string& dbname, const std::string& dbdir, bool nonames) {
359 int rc;

Callers 2

deserialise_databaseFunction · 0.85
clear_log_folderFunction · 0.85

Calls 2

listdir_absFunction · 0.85
isDirectoryFunction · 0.85

Tested by

no test coverage detected