-inline std::string ExpandPath(const std::string &name)
-{
- wordexp_t p;
- char** w;
- wordexp( name.c_str(), &p, 0 );
- w = p.we_wordv;
- std::stringstream s;
- for (size_t i=0; i<p.we_wordc;i++ )
- {
- s << w[i];
- }
- wordfree( &p );
- return s.str();
-}
-
-
-inline std::string ExePath(void)
-{
- char buf[256];
- ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
- len = len > 0 ? len : 0;
- buf[len] = '\0';
- return std::string(buf);
-}
-