MCPcopy Create free account
hub / github.com/Kitware/CMake / realpath

Function realpath

Source/kwsys/SystemTools.cxx:264–277  ·  view source on GitHub ↗

BeOS 5 also doesn't have realpath(), but its C++ API offers something close.

Source from the content-addressed store, hash-verified

262
263// BeOS 5 also doesn't have realpath(), but its C++ API offers something close.
264static inline char* realpath(char const* path, char* resolved_path)
265{
266 size_t const maxlen = KWSYS_SYSTEMTOOLS_MAXPATH;
267 snprintf(resolved_path, maxlen, "%s", path);
268 BPath normalized(resolved_path, nullptr, true);
269 char const* resolved = normalized.Path();
270 if (resolved) // nullptr == No such file.
271 {
272 if (snprintf(resolved_path, maxlen, "%s", resolved) < maxlen) {
273 return resolved_path;
274 }
275 }
276 return nullptr; // something went wrong.
277}
278#endif
279
280#ifdef _WIN32

Callers 8

cf_ssl_peer_key_add_pathFunction · 0.85
uv_exepathFunction · 0.85
uv_exepathFunction · 0.85
uv__fsevents_initFunction · 0.85
uv__search_pathFunction · 0.85
uv__fs_realpathFunction · 0.85
os390_readlinkFunction · 0.85
RealpathFunction · 0.85

Calls 2

PathMethod · 0.80
snprintfFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…