apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: how to test for a valid apr_file_info_t and valid apr_file_t filehandle?
Date Mon, 17 Nov 2003 03:02:25 GMT
William A. Rowe, Jr. wrote:
> At 03:00 PM 11/15/2003, Stas Bekman wrote:
>>In apache 1.3 one could check whether a r->finfo is already opened by checking
whether r->finfo.filehand is non-NULL. However with ap2/apr, r->finfo could be unitilialized
and containing random garbage.
> However, we could null out r->finfo.valid and rest assured that if it remains
> zero, there is no available finfo data.

That would be very good. And I'd love to see an API apr_fileinfo_is_valid 
using that, instead of using a direct test. So if in the future you will want 
to change the logistics for this decision, you will be able to do so.

> apr_finfo_t::valid represents which elements of an apr_finfo_t were populated.
> With the platform discrepancies, this varies from OS to OS.

I know, that's why I propose that API.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

View raw message