httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject Re: cvs commit: apache-apr/include apr_file_io.h
Date Sat, 10 Apr 1999 08:54:27 GMT
On Sat, 10 Apr 1999 01:13:17 -0700, Greg Stein wrote:

>Brian Havard wrote:
>> I can't say I really like what you've done for the directory API. It's way
>> too unix oriented in that it's an almost no-op wrapper for opendir() and
>> friends. Sure, it'll be fast but it's not too portable.
>> The way I see it there shouldn't be any platform specific stuff in
>> apr_file_io.h so putting stuff like:
>>     DIR *dirstruct;
>> typedef struct dirent     apr_dirent_t;
>> in it isn't a good idea. We need to define and use our own structures and
>> hide these platform specific details in the library code.
>Why can't the Apache version have a striking resemblance to Unix's
>"struct direct" ?

It doesn't have a striking resemblance to Unix's "struct direct", it IS
Unix's "struct direct" and specifying it as such in a supposedly portable
header file is ugly. It will have to be #ifdef'd to something else on
platforms that don't have it.

>I don't see a specific need to create a new structure just for its own
>sake. IMO, use what is provided *until* you can demonstrate that it does
>not work somewhere. Jumping the gun and inserting an extra
>layer/translation seems a bit "off" to me.

It doesn't necessarily have to be a new structure that just gets returned
instead. We already have a struct apr_dir_t. The information about the last
entry read could be made available via the pointer to it you already have.

The unix dirent is very limited in that it only contains the file name. Other
platforms (and probably other APIs in unix) provide more details like
date/time stamps, size, attributes etc. which could be made available, saving
an extra stat() type operation when it's wanted.

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message