Home » U++ Library support » U++ Core » GetExeFilePath() in Linux
GetExeFilePath() in Linux [message #6334] |
Tue, 07 November 2006 00:47 |
zsolt
Messages: 698 Registered: December 2005 Location: Budapest, Hungary
|
Contributor |
|
|
I have implemented GetExeFilePath(). It is a little bit tricky, I dont know if it is able to work in BSD systems, but OK for Linux. It is based on the proc filesystem, as there is no standard posix function to this problem (AFAIK).
String GetExeFilePath()
{
char h[_MAX_PATH + 1];
String link;
link << "/proc/" << getpid() << "/exe";
int ret = readlink(link, h, _MAX_PATH);
if(ret == -1 || ret > _MAX_PATH)
return "";
h[ret] = 0;
return FromSystemCharset(h);
}
|
|
|
|
|
GetExeFilePath() in Linux
By: zsolt on Tue, 07 November 2006 00:47
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Tue, 07 November 2006 00:53
|
|
|
Re: GetExeFilePath() in Linux
By: guido on Tue, 07 November 2006 01:53
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Tue, 07 November 2006 09:35
|
|
|
Re: GetExeFilePath() in Linux
By: zsolt on Tue, 07 November 2006 10:09
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Thu, 09 November 2006 20:27
|
|
|
Re: GetExeFilePath() in Linux
By: masu on Thu, 09 November 2006 23:08
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Fri, 10 November 2006 00:13
|
|
|
Re: GetExeFilePath() in Linux
By: zsolt on Fri, 10 November 2006 01:01
|
|
|
Re: GetExeFilePath() in Linux
By: masu on Fri, 10 November 2006 09:22
|
|
|
Re: GetExeFilePath() in Linux
By: zsolt on Fri, 10 November 2006 10:22
|
|
|
Re: GetExeFilePath() in Linux
By: masu on Fri, 10 November 2006 10:48
|
|
|
Re: GetExeFilePath() in Linux
By: zsolt on Fri, 10 November 2006 12:17
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Fri, 10 November 2006 12:23
|
|
|
Re: GetExeFilePath() in Linux
By: zsolt on Fri, 10 November 2006 12:35
|
|
|
Re: GetExeFilePath() in Linux
By: masu on Fri, 10 November 2006 16:28
|
|
|
Re: GetExeFilePath() in Linux
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Sat, 11 November 2006 12:48
|
|
|
Re: GetExeFilePath() in Linux
By: zsolt on Sat, 11 November 2006 13:00
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Sat, 11 November 2006 13:37
|
|
|
Re: GetExeFilePath() in Linux
By: masu on Sun, 12 November 2006 18:11
|
|
|
Re: GetExeFilePath() in Linux
By: guido on Mon, 20 November 2006 07:55
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Wed, 22 November 2006 16:30
|
|
|
Re: GetExeFilePath() in Linux
By: guido on Wed, 22 November 2006 19:04
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Wed, 22 November 2006 19:10
|
|
|
Re: GetExeFilePath() in Linux
By: guido on Wed, 22 November 2006 22:53
|
|
|
Re: GetExeFilePath() in Linux
By: guido on Wed, 22 November 2006 23:07
|
|
|
Re: GetExeFilePath() in Linux
|
|
|
Re: GetExeFilePath() in Linux
By: mirek on Fri, 10 November 2006 10:34
|
Goto Forum:
Current Time: Fri May 10 08:12:11 CEST 2024
Total time taken to generate the page: 0.02968 seconds
|