Finding current executable's path without /proc/self/exe

前端 未结 13 831
有刺的猬
有刺的猬 2020-11-22 01:06

It seems to me that Linux has it easy with /proc/self/exe. But I\'d like to know if there is a convenient way to find the current application\'s directory in C/C++ with cros

13条回答
  •  盖世英雄少女心
    2020-11-22 01:29

    In addition to mark4o's answer FreeBSD also has

    const char* getprogname(void)
    

    It should also be available in MacOS. It's available in GNU/Linux through libbsd.

提交回复
热议问题