This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Repost, different list...File::Spec, Cygwin, Syntactic vs. Semantic path analysis


On Sun, 05 Jan 2003 00:41:31 PST, "LA Walsh" wrote:
>Syntactically, this can't be anticipated or interpreted and the use of a simpl
>e, documented limitation -- the assumption of non-intermixing of \ and / as pa
>thname component separators in the same pathname would be used.  So the first 
>"/" sets the dir sep to "/" and "\" could signal a warning that the syntax is 
>unclear.  But a pathname with "\" as the first dir sep, would throw an illegal
>-filename exception if "/" was encountered, because in places where '\' is a 
>dirsep, '/' is a switch character.

I agree with most of your points, and in particular with the one above.
I consider File::Spec::Win32 currently broken because it hijacks all
paths and turns them into the backslashed variety, which is completely
wrong from the portability POV.  (By which I mean that utilities written
for UNIX that would otherwise work on windows are now broken because of
this change.)

As far as the Win32 native port goes (I'm not really that cygwin-savvy to
comment on what should happen for that port) I like to see:

  * Where there is a prior hint for what the directory separator should
    be (either in the form of (0) an explicit argument specifying the
    separator, or failing that (1) a module/class variable, or failing that
    (2) a preexisting directory separator in one of the path arguments),
    File::Spec should use that for catenating/canonicalizing paths.

  * Where there is no such hint available, File::Spec should default to
    using '/' as the dirsep (which is the portable default and hence
    should always be the preferred one).  Note that this was the
    situation in 5.6.1 and before, so I'm not really that much worried
    about "breaking" the new behavior/bugs.

Thanks,


Sarathy
gsar@ActiveState.com

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]