2

I know it can be done using OS specific code, or Boost, but I can't see a way to do it using the standard library filesystem. Note that current_path wouldn't work as the executable might be called from a different directory.

Community
  • 1
  • 1
Phlox Midas
  • 4,093
  • 4
  • 35
  • 56
  • Possible duplicate of [Get path of executable](http://stackoverflow.com/questions/1528298/get-path-of-executable) – 001 Oct 05 '16 at 14:02
  • Still not platform independent but you might be able to use the current working directory (should be possible to get using `std::filesystem`) and resolve an absolute path using `argv[0]`. – Some programmer dude Oct 05 '16 at 14:06
  • There is no requirement that an executable even *has* a path, so it will be system specific anyway. – Bo Persson Oct 05 '16 at 14:15

0 Answers0