tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: libexec/httpd and unsorted directory index
On Tue, Jan 08, 2008 at 12:07:57AM -0500, James K. Lowden wrote:
> Thor Lancelot Simon wrote:
> > > If its going to sort it probably makes sense to provide the
> > > option of sort key, at least filename & mod asce/desc and
> > > possibly even size, eg "-k {path,size,mtime}". What to do
> > > for descending? '-k -size' (ick)
> >
> > If you want the directory sorted (certainly if you want it sorted in a
> > non-default way), can't you just generate a directory index and put it
> > in index.html?
>
> You can, but that's a cache, and a cache has to be maintained.
>
> Instead of embedding sorting knowledge in the daemon, why not popen(3)
> another binary and let it do the whole job? Pass it a directory name and
> specify the format you want the output in. The output could be an HTML
> table, requiring almost nothing of the daemon.
I think the daemon can already do this. Here is how I arrange for the
daemon to run the CGI program that implements the user interface of one
of our products at work:
httpd -C html /usr/local/www/cgi-bin/gooey -c /usr/local/www/cgi-bin
/usr/local/www
In other words, I tell the daemon to run my CGI programs for all files of
type html, so all pages are supplied by the GUI (because index.html is
the default index, so it always is).
I *think* it should be possible to abuse -M and -C and -x to cause this to
happen for the indices generated automatically when index.html is not
present, though I haven't tried it.
--
Thor Lancelot Simon
tls%rek.tjls.com@localhost
"The inconsistency is startling, though admittedly, if consistency is to
be abandoned or transcended, there is no problem." - Noam Chomsky
Home |
Main Index |
Thread Index |
Old Index