U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » GetExeFilePath() in Linux
Re: GetExeFilePath() in Linux [message #6687 is a reply to message #6684] Wed, 22 November 2006 22:53 Go to previous messageGo to previous message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member
luzr wrote on Wed, 22 November 2006 19:10

OK, what seem wrong to me:

You have your "foo" application somewhere on the PATH. You start it by typing "foo" -> no '\' in the name -> x = x.Left(x.ReverseFind('/')) crashes.

Mirek


Oops, sorry Embarassed

Well, then, when x.ReverseFind('/') fails, a path search, like your current implementation, must be done.

Or this is how OO.org does it:
guido@Sid:~$ cat /usr/bin/openoffice.org-2.0
#!/bin/sh
exec /etc/openoffice.org-2.0/program/soffice "$@"


I only suggest it, because I'm familiar with this method, and because it's portable across POSIX systems. I know, it is how ISPs deal with it, to make their software relocatable and distribution independent.

Guido
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Double formatting bug?
Next Topic: How to catch keyboard input?
Goto Forum:
  


Current Time: Wed Jul 15 13:49:25 GMT+2 2026

Total time taken to generate the page: 0.00939 seconds