You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2001/05/15 16:32:13 UTC

The finfo->name of root?

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.

Bill