[hunchentoot-devel] folder-dispatcher directory listing

Hi all, Lately I've been doing some plain html and javascript hacking on *.html and *.js file, and I found the apache directory listing to be quite handy (IE won't let you run scripts from file:/// so you must host it in a server and access with http://localhost/). I'm using mod_lisp w/ apache so this is not a problem for me but I intend to use hunchentoot alone when it stabilized. I've seen people asking for this before so here's a simple patch to enable directory listing for create-folder-dispatcher-and-handler. Originally I want to change the signature from create-folder-dispatcher-and-handler (uri-prefix base-path &optional content-type) to create-folder-dispatcher-and-handler (uri-prefix base-path &optional create-index-page-p content-type) but it makes it inconsistent with the other api. (and that I don't need to update the documentation :-) Anyway attached are the diffs so feel free to change it if you really don't want the index page enabled by default. Cheers, -- Mac (PS The code should look less horrible if cl-who is available but it's really a pain since I don't want to introduce dependencies to hunchentoot. There is one function copied directly from cl-fad for the same reason)

Scribit Mac Chan dies 15/02/2007 hora 18:35:
(PS The code should look less horrible if cl-who is available but it's really a pain since I don't want to introduce dependencies to hunchentoot. There is one function copied directly from cl-fad for the same reason)
Why not make it a small separate package depending on cl-fad and cl-who, then? Alternatively, Pierre -- nowhere.man@levallois.eu.org OpenPGP 0xD9D50D8A

On 2/15/07, Pierre THIERRY <nowhere.man@levallois.eu.org> wrote:
Why not make it a small separate package depending on cl-fad and cl-who, then?
Alternatively, Pierre
I've seen Edi dump html directly in several places, so I guess it's a ok trade-off. Anyway, turns out that #'directory behaves quite differently in sbcl (and other lisps), and the patch submitted earlier only works on lispworks. So after all I need to pull in cl-fad, I'm not sure if this is a bad thing... -- Mac

On Thu, 15 Feb 2007 19:28:31 -0800, "Mac Chan" <emailmac@gmail.com> wrote:
I've seen Edi dump html directly in several places, so I guess it's a ok trade-off.
Anyway, turns out that #'directory behaves quite differently in sbcl (and other lisps), and the patch submitted earlier only works on lispworks.
So after all I need to pull in cl-fad, I'm not sure if this is a bad thing...
I agree with Pierre that this would be best kept in a separate library. (And this is by the way also what Apache does - directory listings are in a separate module IIRC.) I can give you access to the CVS repository on common-lisp.net if you want to host the code there. Let me know. Thanks for the contribution, Edi.

Edi Weitz <edi@agharta.de> writes:
I agree with Pierre that this would be best kept in a separate library. (And this is by the way also what Apache does - directory listings are in a separate module IIRC.)
Some time ago I wrote a small directory listing utility as a separate package for my own use: I guess other people might find it useful too, so I've just put it for download at this address: http://site.znain.com/dl/lisp/hunchentoot-dir-lister/ You can also try it live here: a simple listing: http://znain.com:8082/hunchentoot-dir-lister/ or here: a "zebra table" listing: http://znain.com:8082/hunchentoot-dir-lister-zebra/ -- dimitre liotev

dl <dl@znain.net> writes:
Edi Weitz <edi@agharta.de> writes:
I agree with Pierre that this would be best kept in a separate library. (And this is by the way also what Apache does - directory listings are in a separate module IIRC.)
Some time ago I wrote a small directory listing utility as a separate package for my own use: I guess other people might find it useful too, so I've just put it for download at this address:
http://site.znain.com/dl/lisp/hunchentoot-dir-lister/
You can also try it live here:
a simple listing: http://znain.com:8082/hunchentoot-dir-lister/
or here:
a "zebra table" listing: http://znain.com:8082/hunchentoot-dir-lister-zebra/
By the way, I've only tested it with SBCL and Firefox on Linux. -- dimitre liotev

On Sun, 18 Feb 2007 06:57:31 -0500, dl <dl@znain.net> wrote:
Some time ago I wrote a small directory listing utility as a separate package for my own use: I guess other people might find it useful too, so I've just put it for download at this address:
Nice, thanks. I've added a link to the Hunchentoot home page.
participants (4)
-
dl
-
Edi Weitz
-
Mac Chan
-
Pierre THIERRY