MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / get_executable_dir

Function get_executable_dir

src/python/package_manager.cpp:40–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 constexpr const char* PYTORCH_INDEX = "https://download.pytorch.org/whl/";
39
40 std::filesystem::path get_executable_dir() {
41#ifdef _WIN32
42 wchar_t path[MAX_PATH_LEN];
43 GetModuleFileNameW(nullptr, path, MAX_PATH_LEN);
44 return std::filesystem::path(path).parent_path();
45#else
46 char path[MAX_PATH_LEN];
47 const ssize_t len = readlink("/proc/self/exe", path, sizeof(path) - 1);
48 if (len != -1) {
49 path[len] = '\0';
50 return std::filesystem::path(path).parent_path();
51 }
52 return std::filesystem::current_path();
53#endif
54 }
55
56 std::pair<int, std::string> execute_process_capture(
57 const std::filesystem::path& program,

Callers 1

uv_pathMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected