MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / CurrentApp

Method CurrentApp

MonaBase/sources/FileSystem.cpp:73–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73FileSystem::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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected