[GRLUG] Paths

Adam Tauno Williams adamtaunowilliams at gmail.com
Sun Sep 21 08:52:13 EDT 2008


> > Is this a feature - or am I missing the point about something - and secondly
> > would it be wise to allow this behaviour in my program for when an
> > individual specifies a path?
> It's common behavior on Linux; Having to path delimiters (//) gets
> collapsed, though I'm not sure where it happens.  In any case, if it's
> a behavior that's everywhere and that people may depend on, it would
> break the user's expectations for you to disallow it in your own code.

Treating doubles ["//"] slashes in a path as a single slash is a
requirement of POSIX.  This it should be supporting everywhere on any
UNIX or UNIX-like platform.

> An example where it's useful: If you have a shell variable $VAR that's
> a path to a directory, and you want to put something in that
> directory, you can simply say $VAR/filename.  If $VAR already has a
> trailing /, the additional one gets collapsed into it.




More information about the grlug mailing list