apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: apr_stat
Date Sat, 20 Jan 2001 01:52:14 GMT
On Fri, Jan 19, 2001 at 12:22:12PM -0600, William A. Rowe, Jr. wrote:
> Thanks, everyone, who's commented so far... here's the plan;
> 
> apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, 
>                       apr_int32_t wantthis, apr_pool_t *p)
> 
> wantthis is the bit flag of attributes we are interested in.  
> Some will always be returned, and the apr_stat function can
> always return anything _they comes for free_.  

Sounds fine.

> apr_stat will reply in a new member value, finfo_valid, to 
> describe the results returned.  It will only fail for the 
> current reasons.  If it can't get a particular result, it 
> just goes on, and it's the caller's job to check finfo.valid.

If I ask for a value and it can't return it, then I should get an error.
I've explicitly said "give me this."

> #define APR_FINFO_LINK   0x00000001
> #define APR_FINFO_MTIME  0x00000010
> #define APR_FINFO_CTIME  0x00000020
> #define APR_FINFO_ATIME  0x00000040
> #define APR_FINFO_SIZE   0x00000100
> #define APR_FINFO_ASIZE  0x00000200
> #define APR_FINFO_CSIZE  0x00000400
> #define APR_FINFO_DEV    0x00001000
> #define APR_FINFO_INODE  0x00002000
> #define APR_FINFO_TYPE   0x00008000

probably 0x00004000 instead.

> #define APR_FINFO_USER   0x00010000 
> #define APR_FINFO_GROUP  0x00020000 
> #define APR_FINFO_UPROT  0x00100000 
> #define APR_FINFO_GPROT  0x00200000
> #define APR_FINFO_WPROT  0x00400000

I don't think we need to differentiate between user/group/world perms.
Return none or return them all.

>...
> I'm suggesting we add asize (allocated size, e.g. for filesystems
> with preallocation) and csize (the actual size consumed on disk.)

Let's leave these out until we have a real need and can properly support
them. This stuff is all so non-portable to begin with, let's not bite off
more than we truly need.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message