httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Hyde <bh...@pobox.com>
Subject Re: APR: directory API
Date Fri, 14 May 1999 16:58:05 GMT

Dean's comments got be thinking, let me throw some ideas in the pot.

I've not looked at the current proposal very carefully.

A bit field to denote "data desired" in the open generator call can
be very useful when you trying to get some uniformity across platforms.
Then the platform specific call can pick the OS call pattern that's
cheapest given the request being made.

 ap_file_list *fi = ap_file_list_create(p, pattern, APDI_MOD_TIME|APDI_SIZE|APDI_RECURSE)
  ...
  while(ap_file_list_advance(fi)){
    if( intersting(ap_file_iterator(fi)) ){
      ap_rprintf(r, "<td>%s</td><td>%d</td>",
                 ap_file_name(fi),
                 ap_file_size(fi));
    }
  }
  ...

The doc should say it is an error to call ap_file and it's ilk
prior to the first advance, or after advance returns non-nil,
otherwise ap_file_name et. al never generate errors.

You can get much the same effect by having N different create iterator
operations.

We did discuss at one time using file:/... URL's for this kind of thing.
That folds into the issue of how low in the archetecture we should
start using uri_components and the other stuff currently in util_uri.
There was a time when I thought that would be an important data
structure, but these days it seems almost unnecessary.

If what this generator generates is uri_components then one would
put fields in there for various dates, sizes, mime types, along
with a bit field to indicate where ones held valid data.

 - ben

Mime
View raw message