apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject The finfo->name of root?
Date Tue, 15 May 2001 14:32:13 GMT
Ok, I have a fix to commit for 'statting' the root on Win32, but it 
raises an interesting question to resolve first.

When we added the APR_FINFO_NAME field, I never really considered
a couple of obscure entities.  Like root.  Or the distinction of
/foo v.s. /foo/.

Stat the unix root "/" and what name do you expect back?  Or even
statting "/foo/"?  If you stat /foo, you expect "foo", of course.

On Win32 it gets a little trickier, we could be trying "c:/", "q:"
or //foo/bar/, all of which are 'roots' of one sort or another.

My instinct in all these cases is to return the generic identity,
"." which is 1. faster, and 2. forces the coder to think through their
question.  Of course, I'll document the behavior (whatever it is.)

The point I'm making is that calling fileinfo for "/ntmount/foo"
on unix should, ultimately, force us to dirwalk "/ntmount/" for a
name/inode pair that matches the stat of "/ntmount/foo".  If the user 
asks for the APR_FINFO_NAME of "/ntmount/foo/", should we skip that?

[remember, finfo(APR_FINFO_NAME) won't proper-case the whole string,
only the file name element.  Is there a name element in "/foo/"?]

The other option is to return the empty string, I suppose, or just
refuse to return the name element (APR_EINCOMPLETE), but that seems
in bad form.


View raw message