0

Like the title says I'm in a search for a way to do to do the initial_path(). As you can see here there is no replacement: http://www.boost.org/doc/libs/1_46_0/libs/filesystem/v3/doc/deprecated.html

NoSenseEtAl
  • 28,205
  • 28
  • 128
  • 277

2 Answers2

1

Why not just remember it yourself with some variable? Why do you need boost to take care of this? As they say in the docs, this is trivially taken care of by the user.

Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203
1

Are you looking for a way to get full path to your executable ?

Read this SO question

I think the answer is as below (thanks to Mike)

Here's code to get the full path to the executing app:

Windows:

int bytes = GetModuleFileName(NULL, pBuf, len);
if(bytes == 0)
        return -1;
else
        return bytes;

Linux:

char szTmp[32];
sprintf(szTmp, "/proc/%d/exe", getpid());
int bytes = MIN(readlink(szTmp, pBuf, len), len - 1);
if(bytes >= 0)
        pBuf[bytes] = '\0';
return bytes;
Community
  • 1
  • 1
O.C.
  • 6,711
  • 1
  • 25
  • 26