Well i'm trying to get the path from which my app was launched so when it gets an exception i can just handle it and restart it, the only solution to this that i found was getenv ( "PATH" ), however doing this yields this:

[Sat Apr 28 19:29:37 2007](null)/gtamp.cfg

are there any alternatives to this that also work under a linux environment?

Recommended Answers

All 3 Replies

argv[0] contains the full path to the program. I don't think the PATH environment variable will help you because it contains a huge number of semi-colon separated directories.

Cheer, works fine now with some formatting:

[Sat Apr 28 20:07:08 2007]C:\Program Files\Rockstar Games\GTA San Andreas\gtamp.cfg

If your path looks like that, I'd say you've got other problems in the code as well, because it looks like something has been trashed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.