| 71 | |
| 72 | |
| 73 | FileSystem::CurrentApp::CurrentApp() { |
| 74 | resize(PATH_MAX); |
| 75 | #ifdef _WIN32 |
| 76 | int n = GetModuleFileNameA(0, &(*this)[0], PATH_MAX); |
| 77 | if (n <= 0 || n > PATH_MAX) { |
| 78 | clear(); |
| 79 | return; |
| 80 | } |
| 81 | #else |
| 82 | // read the link target into variable linkTarget |
| 83 | ssize_t n = readlink("/proc/self/exe", &(*this)[0], PATH_MAX); |
| 84 | if(n<=0) { |
| 85 | clear(); |
| 86 | return; |
| 87 | } |
| 88 | #endif |
| 89 | resize(n); |
| 90 | } |
| 91 | |
| 92 | |
| 93 |
nothing calls this directly
no outgoing calls
no test coverage detected