[Starkit] Re: starpack as cgi

David Welton davidnwelton at gmail.com
Wed Jun 22 15:35:02 CEST 2005


> > It's kind of ugly, maybe there are better ways.  Perhaps looking at
> > [pwd] + argv0 to see if that is an executable file?

> Hm, in some of my programs I have had very similar problems.
> That is: I need to know where the executable lives and not in all
> circumstances (*) argv[0] (C programs) would contain the path.
 
> So instead of only relying on the information in argv[0], I also
> scan the path environment variable to see what directories it
> might live in. Perhaps that could be done here too?

Tcl already tries to scan the path.   The problem is if you have a
file, say, foo.cgi, which is not in the path, that receives the argv0
'foo.cgi'.  So looking in the PATH isn't going to help in this case -
we're already sure it's not there.

-- 
David N. Welton
 - http://www.dedasys.com/davidw/

Apache, Linux, Tcl Consulting
 - http://www.dedasys.com/


More information about the Starkit mailing list