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

Function isDirectory

tools/comdb2ar/util.cpp:202–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202bool isDirectory(const std::string& file) {
203 struct stat st;
204 int rc;
205
206 rc = stat(file.c_str(), &st);
207 if (rc == -1)
208 throw Error("Error stat(\"" + file + "\")");
209
210 if (S_ISDIR(st.st_mode))
211 return true;
212 else
213 return false;
214}
215
216void make_dirs(const std::string& dirname)
217// Ensure that a directory given by absolute path dirname exists

Callers 1

remove_all_old_filesFunction · 0.85

Calls 2

ErrorClass · 0.85
statClass · 0.70

Tested by

no test coverage detected