Subject: Re: Repost, different list...File::Spec, cygwin, Syntactic vs. Semantic path analysis
From: Christopher Faylor <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Mon, 6 Jan 2003 13:02:41 -0500

On Mon, Jan 06, 2003 at 09:43:30AM -0800, LA Walsh wrote:
>So it seems that 'syntactically', one can't always determine if a "/" is
>invalid in a straight win32 environment -- at least not when a network name
>is involved, but I'd agree it is pathological and should be ignored (and
>documented as ignored for pathological share names)

I am not clear on why we are devoting so much time to what is required
for a straight win32 environment in a cygwin mailing list.  As odd as it
sounds, this seems somewhat off-topic to me.  Or at least uninteresting.

>So I'd suggest the following:
>
>I. 
>Win32 syntactic normalization should always proceed to return "\".
>
>Cygwin is a Posix compatibility layer for Win32, though -- it isn't 
>supposed to be a complete replacement/invalidation of the underlying Win32
>layer -- unless one wants to declare that "e:foobar" only can reference a
>file and simulate "foobar\fee" as a valid file (through some mechanism).
>
>For cygwin to be a useful constructor of utils -- it should hand both Posix
>names *and* win32 names.  Normalization can return "/" for any filename that
>doesn't have, say, a <colon> in it -- but ... no... I agree it should always
>return "/" for _syntactic_ normalization....and *document* that "\" will be
>converted to / even if a remote fs allows "\" as a filename character.

You could take the radical approach of having a cygwin perl module
reject backslashes and colons entirely.  Whatever you do *please* do not
make the mistake of converting slashes to backslashes in anything that
is seen by cygwin functions.  If you convert backslashes to slashes then
you will be introducing an inconsistency between the way cygwin handles
these types of paths and the way the perl module interprets them.  Backslashes
and colons in paths short-circuit mount table operations in cygwin.  So,
\usr\bin is not equivalent to /usr/bin.

I'd like to ignore this tempest in a teapot entirely but I sure don't
want to see someone implement a perl module that does the wrong thing
for cygwin.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/