Re: Euphoria environment variables (was: quick cgi question)
- Posted by Juergen Luethje <j.lue at gmx.de> Apr 02, 2006
- 479 views
Me wrote: > Ed Davis wrote: <snip> >> But is this cross-platform? >> >> Under DOS and Windows, C compilers use argv[0] to get the complete path >> to the program. >> >> However, argv[0] isn't populated the same way under Linux. argv[0] >> appears to contain the command string that was typed to start the >> executable. This is on RedHat, SlackWare, and Knoppix. I assume the >> other distributions are the same? >> >> I don't know about FreeBSD, but I assume this is a Unix thing. >> >> So, how does a program find the complete path to itself on Linux? > > I don't know how this would work with C, but fortunately the Euphoria > interpreter front-end and translator are written in Euphoria now. > > }}} <eucode> <snip> What I forgot to mention: As I understand the documentation of Eu's command_line() function, at least for executable files the second element always contains its full path name. Can you confirm that regarding some Linux distributions? Regards, Juergen