tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: libexec/httpd and unsorted directory index

In article <>,
Thor Lancelot Simon  <> wrote:
>On Mon, Jan 07, 2008 at 10:52:23PM +0000, David Brownlee wrote:
>> On Mon, 7 Jan 2008, Jeremy C. Reed wrote:
>> >httpd(8) provides -X for generating index.
>> >
>> >src/libexec/httpd/dir-index-bozo.c uses opendir/readdir with no sorting.
>> >
>> >Looking at long index like under the /pub/pkgsrc/... directories is a
>> >little difficult because entries are not sorted alphabetically nor by
>> >modification time.
>> >
>> >Should it use glob or scandir with alphasort or other?
>>      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)
>Really, it would be nice to avoid cat's camel's back here.
>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?

I agree with thor. This is a slippery slope. What is next? Icon support
and sorting with clickable column headers? Any sorting will require
memory allocation and buffering which leads to more code, DOS's etc.


Home | Main Index | Thread Index | Old Index