>>>>> "Robert" == Robert Bunn <[EMAIL PROTECTED]> writes:
Robert> Hi, listizens.
Robert> I've been trying to build an automated web site, where sections of the
Robert> site are subdirectories of the document root. What I'm looking for is
Robert> a way, preferably easy and convenient, for a cgi script residing in
Robert> /arbitrary/cgi/directory to get a directory listing of
Robert> /other_arbitrary/webserver/document/root.
That's not possible in general. The mapping from /URI to /file/path
is completely in the mind of the webserver, and not necessarily
available to mortal CGI programs. $ENV{DOCUMENT_ROOT} gives a
starting place, but most servers then have a complex series of Alias
and ScriptAlias directives that map and remap the URIs to files. In
fact, many URIs won't even map to files!
If you are using mod_perl, you can ask through the API for a filename
for a given URI, but that's not available to CGI, and even that could
be a lie based on browser type, negotiated options or languages, and
so on.
So, you'll need to rethink your strategy. Maybe you'll be able to do
this for the most trivial cases, but you'll not be able to do it for a
*typical* real-world case.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]