poco
poco copied to clipboard
Add Path::self()
Add an easy way to obtain the executable path. win/linux/mac only for now. https://stackoverflow.com/a/1024937/205386
@aleks-f pls assgin to me.
@matejk see if we can squeeze this into 1.13. (needs to be properly tested on all major platforms; if not, push to 1.14
Just as curiosity:
GNU provides simpler way to get program name if _GNU_SOURCE is defined through a constant C string:
extern char *program_invocation_name;
extern char *program_invocation_short_name;
https://man7.org/linux/man-pages/man3/program_invocation_name.3.html
Linux, macOS and BSD also feature getprogname: https://www.unix.com/man-page/netbsd/3/getprogname/
On Windows, there is also __argv[0]
.