MCPcopy Create free account
hub / github.com/apple/foundationdb / joinPath

Function joinPath

flow/Platform.actor.cpp:2215–2223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2213} // namespace platform
2214
2215std::string joinPath(std::string const& directory, std::string const& filename) {
2216 auto d = directory;
2217 auto f = filename;
2218 while (f.size() && (f[0] == '/' || f[0] == CANONICAL_PATH_SEPARATOR))
2219 f = f.substr(1);
2220 while (d.size() && (d.back() == '/' || d.back() == CANONICAL_PATH_SEPARATOR))
2221 d.resize(d.size() - 1);
2222 return d + CANONICAL_PATH_SEPARATOR + f;
2223}
2224
2225void renamedFile() {
2226 INJECT_FAULT(io_error, "renameFile"); // renaming file failed

Callers 11

atomicReplaceFunction · 0.70
abspathFunction · 0.70
string>> findFilesMethod · 0.70
findFilesRecursivelyFunction · 0.70
Platform.actor.cppFile · 0.70
getKeyPathSyncMethod · 0.70
cleanupTraceFilesMethod · 0.70

Calls 4

substrMethod · 0.80
sizeMethod · 0.45
backMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected