Sven Hartrumpf | 30 Jan 20:38
Picon

directory listing in hop?

Hi all.

Which function in hop is called when hop automatically lists
the contents of a directory on a hop server?

Ciao
Sven

Manuel.Serrano | 4 Feb 07:35
Picon
Picon
Favicon

Re: directory listing in hop?

Hi Sven,

> Which function in hop is called when hop automatically lists
> the contents of a directory on a hop server?
The function directory->response is in charge of returning a directory list.
It is defined in runtime/http_response.scm. 

This can be overridden using a local hook. In the ~/.config/hop/hoprc.hop file
you may add something such as:

(hop-http-response-local-hook-add!
   (lambda (req::http-request resp)
      (if (directory? req.abspath)
          ... do whatever you want ...
          resp)))

Cheers,

--

-- 
Manuel
Sven Hartrumpf | 4 Feb 16:47
Picon

Re: directory listing in hop?

Hi Manuel.

Sat, 4 Feb 2012 07:35:23 +0100, Manuel.Serrano wrote:
>> Which function in hop is called when hop automatically lists
>> the contents of a directory on a hop server?
> The function directory->response is in charge of returning a directory list.

Thanks for the information.

> This can be overridden using a local hook. In the ~/.config/hop/hoprc.hop file
> you may add something such as:

I do not want to overwrite the definition; I wanted
to report two bugs and make your life easier by
adding fixes for them.

Bug 1:
The href for a directory occurring in the currently listed
directory (by directory->response) is missing the trailing /.
Patch for hop attached.

Bug 2:
The href for an entry shown by directory-response contains a double /
if the calling function includes a trailing slash for the argument.
This happens when browsing a hop directory tree.
Patch for bigloo attached (a generalization of make-file-name).

Ciao
Sven
(Continue reading)

Manuel.Serrano | 6 Feb 15:52
Picon
Picon
Favicon

Re: directory listing in hop?

> I do not want to overwrite the definition; I wanted
> to report two bugs and make your life easier by
> adding fixes for them.
Wonderful! Both patch applied. Thanks a lot.

--

-- 
Manuel

Gmane