MCPcopy Create free account
hub / github.com/apache/impala / IsCanonicalPath

Method IsCanonicalPath

be/src/util/filesystem-util.cc:227–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227bool FileSystemUtil::IsCanonicalPath(const string& path) {
228 return !path.empty()
229 && path.front() == '/'
230 && (path.length() == 1 || path.back() != '/')
231 && (path.length() == 1 || strcmp(path.c_str() + path.length() - 2, "/.") != 0)
232 && (path.length() <= 2 || strcmp(path.c_str() + path.length() - 3, "/..") != 0)
233 && strstr(path.c_str(), "//") == nullptr
234 && strstr(path.c_str(), "/./") == nullptr
235 && strstr(path.c_str(), "/../") == nullptr;
236}
237
238Status FileSystemUtil::IsSymbolicLink(const string& file_path, bool* is_symbolic_link,
239 string* canonical_path) {

Callers

nothing calls this directly

Calls 3

frontMethod · 0.80
emptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected