Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 4049 invoked by uid 6000); 12 May 1999 15:14:44 -0000 Received: (qmail 4020 invoked from network); 12 May 1999 15:14:37 -0000 Received: from silk.apana.org.au (root@202.12.87.81) by taz.hyperreal.org with SMTP; 12 May 1999 15:14:37 -0000 Received: from kheldar.apana.org.au (bjh@kheldar.apana.org.au [202.12.87.82]) by silk.apana.org.au (8.9.1/8.9.1) with SMTP id BAA16334 for ; Thu, 13 May 1999 01:14:13 +1000 Message-Id: <199905121514.BAA16334@silk.apana.org.au> From: "Brian Havard" To: "Apache Developers Mailing List" Date: Thu, 13 May 1999 01:14:13 +1000 (EST) X-Mailer: PMMail 2.00.1500 for OS/2 Warp 4.00 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: APR: directory API Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Now that the dust has settled (I hope) over the ap/apr argument I'd like to bring up the problem I still have with the directory API. The problem is that ap_readdir() still returns a dirent *. It may be hidden under several layers of typedef but that's still what it is and still has to be treated as such by the API user. IE you have to access the file name as ent->d_name. The test program even uses d_ino which is far from portable. I presented what I think is a better solution a while back in message <199904110149.LAA11629@silk.apana.org.au> and I'd be happy to implement it for the platforms I have access to (OS/2, Unix and Win32) if it's generally approved of. Not only is it fully platform independent but provides more possibilities for exploiting the features of of each platform. I also think it's cleaner in that there's only one data structure for the user to keep track of instead of two. It looked something like this: apr_dir_t *apr_opendir(const char *); apr_status_t apr_closedir(apr_dir_t *); apr_status_t apr_readdir(apr_dir_t *); apr_ssize_t apr_dir_entry_size(apr_dir_t *); apr_time_t apr_dir_entry_mtime(apr_dir_t *); apr_status_t apr_rewinddir(apr_dir_t *); Note no apr_dirent_t at all. It would be use like: thisdir = apr_opendir("foo/bar"); if (thisdir) { while(apr_readdir(thisdir) == APR_SUCCESS) { printf("%s %d\n", thisdir->entryname, apr_dir_entry_size(thisdir)); } } -- ______________________________________________________________________________ | Brian Havard | "He is not the messiah! | | brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of Brian | ------------------------------------------------------------------------------