apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Greig <sgr...@altair.com>
Subject RE: Bug in unix apr_stat involving the name field.
Date Mon, 20 Sep 2004 18:23:37 GMT
I had fixed my problem by memset-ing my apr_finfo_t to 0 before calling
apr_stat, then checking for a non-null name before using it.

I was not testing for the valid bit, I'll change to this method.

So apr_stat is working correctly. 

Thanks for the information.
- Scott


-----Original Message-----
From: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net] 
Sent: Monday, September 20, 2004 1:39 PM
To: Scott Greig
Cc: dev@apr.apache.org
Subject: Re: Bug in unix apr_stat involving the name field.

At 11:53 AM 9/20/2004, you wrote:

>The following works on win32 but not on linux.  Looks like the name field
of
>apr_finfo_t is never set on unix so the value is garbage.  

are you testing the .valid bit APR_FINFO_FNAME value?

There are scenarios on every platform when specific fields
cannot be set, it's important to check the .valid bits.

If apr_stat(...., APR_FINFO_NAME, poll) returns APR_SUCCESS, that
would be a bug, the correct return code is APR_INCOMPLETE.

It would be -totally- wrong to just stuff the name passed for
Unix, because some Unix file systems, e.g. mounted from Samba, 
HFS (Mac OS), and others can return another file from a 
non-canonical name.

Bill


Mime
View raw message