[GRLUG] Paths

Greg Folkert greg at gregfolkert.net
Sun Sep 21 23:22:49 EDT 2008


On Sun, 2008-09-21 at 08:52 -0400, Adam Tauno Williams wrote:
> > > 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.

Uhh, what is POSIX? 

Surprisingly Wikipedia is pretty good on this particular one:

	http://en.wikipedia.org/wiki/POSIX

Of course, you can pay for the real definition.

> > 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.
-- 
greg at gregfolkert.net
PGP key 1024D/B524687C 2003-08-05
Fingerprint: E1D3 E3D7 5850 957E FED0  2B3A ED66 6971 B524 687C
Alternate Fingerprint: 09F9 1102 9D74  E35B D841 56C5 6356 88C0
Alternate Fingerprint: 455F E104 22CA  29C4 933F 9505 2B79 2AB2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://shinobu.grlug.org/pipermail/grlug/attachments/20080921/319c6673/attachment.pgp 


More information about the grlug mailing list