[Zope3-dev] Notations for paths

Marius Gedminas mgedmin@codeworks.lt
Fri, 20 Dec 2002 18:29:45 +0200


On Fri, Dec 20, 2002 at 05:07:24PM +0100, Florent Guillaume wrote:
> Can it be stated here that empty name are a priori legal?
> So that we don't have to disambiguate double slashes or final slashes?
> A final slash means traverse to an empty name as the last step, a double
> slash somewhere means an empty name at that point.
> 
> The problem then is that we have no way to represent the location of an
> object at the root with an empty name.
> 
> Solutions:
>  - disallow empty names at the root
>  - disallow empty names everywhere
> 
> Which do you prefer?

I think no empty names at all makes more sense.

For example, in POSIX extra slashes are allowed, so 'a/b' and 'a//b'
mean the same thing.  In most cases trailing slash is also ignored, so
'a/b' is equivalent to 'a/b/'.  This is very useful for shell scripts,
where you can combine path elements like foo/$xxx/$bar (where xxx can
contain several elements, e.g. 'a/b/c') without the need to deal with
corner cases (xxx='') separately.  This would not work if path elements
could be empty strings.

BTW POSIX has the sanest filesystem namespace semantics I've seen.

Marius Gedminas
-- 
"If we were meant to fly, we wouldn't keep losing our luggage."