Re: Wrapped application directory oddity
- From: Robert Heller <heller@xxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 03:20:26 +0200
At Fri, 29 Jun 2007 21:48:19 GMT "Jeff Godfrey" <jeff_godfrey@xxxxxxxxx> wrote:
"Melissa Schrumpf" <m_schrumpf_at_yahoo_com_NOT@xxxxxxxxxxxxx> wrote
in message
news:m_schrumpf_at_yahoo_com_NOT-E6B868.17282829062007@xxxxxxxxxxxxxxxxxxxxxxxxxxx
In article <mMchi.2140$Od7.623@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"Jeff Godfrey" <jeff_godfrey@xxxxxxxxx> wrote:
Any ideas on what would cause the botched paths under CGI?
"//?/D:WebHosting/..."
http://machinename/D:WebHosting
My guess is it is the method the web server uses to spawn the
subprocess.
Note that on windows, creating a new process can actually have *two*
arguments that define what executable is run, and they are used in
different ways.
Google CreateProcess(), find it at MSDN, and read the sections on
lpApplicationName and lpCommandLine for more info.
Melissa,
Thanks for the information. I'll study the info that you've provided.
I guess my next questions would be:
1. Why did [pwd] return a different path (and more expected) format
than the other commands? I assume it must retrieve its info
differently at the 'C' level?
2. Does this indicate a problem in some of the mentioned commands in
this circumstance? If nothing else, shouldn't the format of the
return value be the same for all commands in question?
3. Ultimately, I'm trying to programmatically determine the absolute
path to the CGI exe itself - so I can access a config file that will
sit beside it. I guess I can repair the return value of [info
executable] in this case, but still wonder if these results are
expected? Perhaps I should be filing a bug report?
Doesn't the CGI standard define environment variables for this?
From one of my CGI scripts:
global env DOCUMENT_ROOT SERVER_NAME
if {[catch "set env(DOCUMENT_ROOT)" DOCUMENT_ROOT]} {
set DOCUMENT_ROOT /home/deepwood/WWW
}
if {[catch "set env(SERVER_NAME)" SERVER_NAME]} {
set SERVER_NAME www.deepsoft.com
}
source [file join [file dirname $DOCUMENT_ROOT] TclIncludes/cgi.tcl]
cgi_root http://$SERVER_NAME/cgi-bin
global BaseHTML
set BaseHTML http://$SERVER_NAME/Deepwoods
global BaseHTMLIncludes
set BaseHTMLIncludes $DOCUMENT_ROOT
Or am I thinking too much of what happens under UNIX/Linux/Apache?
Thanks for any additional input.
Jeff
--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller@xxxxxxxxxxxx -- Contract Programming: C/C++, Tcl/Tk
.
- Follow-Ups:
- Re: Wrapped application directory oddity
- From: Jeff Godfrey
- Re: Wrapped application directory oddity
- References:
- Wrapped application directory oddity
- From: Jeff Godfrey
- Re: Wrapped application directory oddity
- From: Jeff Godfrey
- Re: Wrapped application directory oddity
- From: Melissa Schrumpf
- Re: Wrapped application directory oddity
- From: Jeff Godfrey
- Wrapped application directory oddity
- Prev by Date: Re: A widget for the user's editor of choice
- Next by Date: Re: Wrapped application directory oddity
- Previous by thread: Re: Wrapped application directory oddity
- Next by thread: Re: Wrapped application directory oddity
- Index(es):