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

Function empty_dir

tools/comdb2ar/deserialise.cpp:310–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310static bool empty_dir(const std::string& dir) {
311 DIR *d;
312 struct dirent *f;
313 d = opendir(dir.c_str());
314 if (d == NULL)
315 return false;
316 while ((f = readdir(d)) != NULL) {
317 if (strcmp(f->d_name, ".") == 0 || strcmp(f->d_name, "..") == 0)
318 continue;
319 return false;
320 }
321 return true;
322}
323
324static bool check_dest_dir(const std::string& dir)
325// REALLY REALLY REALLY important safety check - without this

Callers 2

check_dest_dirFunction · 0.85
deserialise_databaseFunction · 0.85

Calls 2

opendirFunction · 0.50
readdirFunction · 0.50

Tested by

no test coverage detected