ClickHouse/src/Common/getExecutablePath.cpp

14 lines
274 B
C++
Raw Normal View History

2019-08-11 20:37:53 +00:00
#include <Common/getExecutablePath.h>
#include <filesystem>
std::string getExecutablePath()
{
std::error_code ec;
std::filesystem::path canonical_path = std::filesystem::canonical("/proc/self/exe", ec);
if (ec)
return {};
return canonical_path;
}