[Boost-bugs] [Boost C++ Libraries] #12869: Getting the path of the current executable

Subject: [Boost-bugs] [Boost C++ Libraries] #12869: Getting the path of the current executable
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-02-25 12:08:01


#12869: Getting the path of the current executable
-------------------------------------+--------------------------
 Reporter: vervaeck.sam@… | Owner: bemandawes
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost Development Trunk | Severity: Optimization
 Keywords: |
-------------------------------------+--------------------------
 I couldn't find any other ticket relating to this issue, so I'm asking
 here. I think it would be ''really'' useful if Boost's FileSystem included
 a method for getting the path of the current executable in a cross-
 platform way. I needed this kind of functionality myself just now because
 I needed to find some files relative to the executable's dir, and I think
 that a lot of projects can benefit from it. As goes without saying, a
 solution for this problem in a mature well-tested library beats a
 ''quickfix'' in one of my own projects.

 As has been noted in several threads on StackOverflow, using `argv[0]` to
 derive the current path has its flaws on many platforms (including mine).
 A more robust solution would be to use e.g. `GetModuleFileName` on Windows
 and `/proc/self/exe/` on Linux. The code can I think be fairly easily
 copied from [http://stackoverflow.com/a/34109000/1173521 this
 StackOverflow answer], which, according to the author, has been tested on
 various platforms.

 Regards,
 Sam

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12869>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-25 12:12:00 UTC