MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / FixBazelEnvPath

Function FixBazelEnvPath

tensorflow/core/lib/io/path.cc:109–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109bool FixBazelEnvPath(const char* path, string* out) {
110 if (path == nullptr) return false;
111 if (out == nullptr) return true;
112
113 *out = path;
114
115#ifdef PLATFORM_WINDOWS
116 // On Windows, paths generated by Bazel are always use `/` as the path
117 // separator. This prevents normal path management. In the event there are no
118 // `\` in the path, we convert all `/` to `\`.
119 if (out->find('\\') != string::npos) return path;
120
121 for (size_t pos = out->find('/'); pos != string::npos;
122 pos = out->find('/', pos + 1)) {
123 (*out)[pos] = kPathSep[0];
124 }
125#endif
126
127 return true;
128}
129} // namespace internal
130
131bool IsAbsolutePath(StringPiece path) {

Callers 1

Calls 1

findMethod · 0.45

Tested by

no test coverage detected