Forum OpenACS Q&A: __ns_dirlist, fastpath, OpenACS 4.6.3
ns_param directoryproc css_dirlist ;# the name of the new procedure.
ns_param directorylisting fancy ;# Can be simple or fancy.
In the directory listing, it appears that the filename links are being truncated after the first space.
I tried modifying the __ns_dirlist function in fastpath.tcl to use the string map function to replace spaces with %20, but it does not appear that the function is being called (I added some ns_log lines, and nothing is showing up in the log file). Then I downloaded the css_dirlist from http://zmbh.com/dirlist/, modified nsd.tcl accordingly, but it doesn't appear that it is being called either.
Does OpenACS 4.x do directory listings differently? I don't have problems on my OpenACS 3.x site.
OpenACS has rolled ns_dirlist (or at least the creation of an index page) into the request processor. I don't have the time to look up exactly where but you can find it by searching for lines from the fastpath.tcl _ns_dirlist function in the OpenACS code base.
Yes it does do things differently. Actually OpenACS copies the function of the dirlist proc, which is why it doesn't show up like you want it to, I had the same problem and it took me a while to figure out the problem.
I have set this up to work in the current version of OpenACS, let me see if I can get a copy of what I did.
set link "<a href=$tail>$tail</a>"
set link "<a href=\"$tail\">$tail</a>"
(notice the quotes)
Okay, I tracked down what I did, which was simply to add a file "global/file-not-found.tcl", and a new configuration param under redirects.
The full instructions on a slightly nicer dirlist, plus all the files are at http://zmbh.com/dirlist/. Download the tar file.
Note that the dirlist proc provided with OpenACS, as I tested it, would display the contents of _any_ directory which didn't have an index file (those under package www directories). My file-not-found file ensures the directory is under the actual pageroot of the server.