| 510 | namespace { |
| 511 | |
| 512 | Result<NativePathString> NativeReal(const NativePathString& path) { |
| 513 | #if _WIN32 |
| 514 | std::array<wchar_t, _MAX_PATH> resolved = {}; |
| 515 | if (_wfullpath(const_cast<wchar_t*>(path.c_str()), resolved.data(), resolved.size()) == |
| 516 | nullptr) { |
| 517 | return IOErrorFromWinError(errno, "Failed to resolve real path"); |
| 518 | } |
| 519 | #else |
| 520 | std::array<char, PATH_MAX + 1> resolved; |
| 521 | if (realpath(path.c_str(), resolved.data()) == nullptr) { |
| 522 | return IOErrorFromErrno(errno, "Failed to resolve real path"); |
| 523 | } |
| 524 | #endif |
| 525 | return NativePathString{resolved.data()}; |
| 526 | } |
| 527 | |
| 528 | } // namespace |
| 529 |
nothing calls this directly
no test coverage detected