MCPcopy Create free account
hub / github.com/dmlc/parameter_server / removeExtension

Function removeExtension

src/util/file.cc:406–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404 return join(elems, "/");
405}
406string removeExtension(const string& file) {
407 auto elems = split(file, '.');
408 if (elems.size() <= 1) return file;
409 if (elems.back() == "gz" && elems.size() > 2) elems.pop_back();
410 elems.pop_back();
411 return join(elems, ".");
412}
413
414bool dirExists(const std::string& dir) {
415 struct stat info;

Callers 1

searchFilesFunction · 0.85

Calls 4

splitFunction · 0.85
joinFunction · 0.85
backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected