This is the mail archive of the cygwin 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: UNC Pathname Handling within Applications


On Thu, Jul 15, 2004 at 06:48:36AM +0200, Thorsten Haude wrote:
>Hi,
>
>* Christopher Faylor wrote (2004-07-15 06:15):
>>On Thu, Jul 15, 2004 at 05:32:32AM +0200, Thorsten Haude wrote:
>>>I know that NEdit is not the only application ignoring multiplied
>>>slashes, so I wonder how this is normally handled with Cygwin. Indeed,
>>>a simple test on Linux seems to indicate that fopen() accepts any
>>>number of slashes, so this is not isolated to NEdit.
>>
>>Why would the fact that linux can open files with any number of slashes
>>indicative of a problem with other applications?  Cygwin can open files
>>with any number of slashes too as long as they are not the first slash.
>
>I only wanted to point out that this might not be the first time that
>this particular problem came up.
>
>
>>>- The user guide ("Mapping path names") does tell me something about
>>>what's to expect but little about implementation.
>>
>>Implementation of what?  It isn't obvious what you are expecting cygwin
>>to do or how you are expecting it to help.  By the time Cygwin sees the
>>file spec the extra slash has been removed.  There is no amount of help
>>that cygwin can provide at that point.
>
>Well, Cygwin does already provide services for converting filenames,
>so I thought it might be worthwhile to ask whether similar services
>exist for the point in question.

The only services that are available are for translating cygwin path
names to and from Windows path names.  Filenames beginning with two
slashes are both valid cygwin path names and windows path names so there
is no conversion routine necessary.

>>This is an application problem, not a windows or cygwin problem.  Double
>>slashes at the beginnning of a path name are allowed to mean something
>>different and if an application doesn't recognize that fact, that is at
>>least arguably a bug.
>
>Where is it defined that double slashes at the beginning of a path are
>allowed to mean something?  Is this C?  Posix?  To find the source of
>this convention could really help to find the best way to remove this
>problem.

http://www.opengroup.org/onlinepubs/007908799/xbd/glossary.html#tag_004_000_196

This says that an implementation is allowed to consider two leading
slashes as special.  You still have to look at Nedit's code and fix it
so that two leading slashes are not compressed into one, however.  I
don't know why knowing that someone says it's official helps much.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]