| 76 | } |
| 77 | |
| 78 | std::filesystem::path LinuxPath::getLocalPath() const |
| 79 | { |
| 80 | auto localPath = std::filesystem::current_path() / ""; |
| 81 | |
| 82 | static const std::filesystem::path statusPaths[] |
| 83 | = { "/proc/self/exe", "/proc/self/file", "/proc/curproc/exe", "/proc/curproc/file" }; |
| 84 | |
| 85 | for (const auto& path : statusPaths) |
| 86 | { |
| 87 | std::error_code ec; |
| 88 | const auto binPath = read_symlink(path, ec); |
| 89 | if (ec.value() != -1) |
| 90 | { |
| 91 | localPath = binPath.parent_path() / ""; |
| 92 | break; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | return localPath; |
| 97 | } |
| 98 | |
| 99 | std::filesystem::path LinuxPath::getGlobalDataPath() const |
| 100 | { |