Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
To: cygwin@cygwin.com
From: Shankar Unni <shankarunni@netscape.net>
Subject: Re: UNC Pathname Handling within Applications
Date: Thu, 15 Jul 2004 15:52:46 -0700
Lines: 24
Message-ID: <cd71s1$rbd$1@sea.gmane.org>
References: <20040715033232.GP25893@eumel.yoo.local>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@sea.gmane.org
X-Gmane-NNTP-Posting-Host: adsl-68-120-146-125.dsl.snfc21.pacbell.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Thunderbird/0.7.1 Mnenhy/0.6.0.101
In-Reply-To: <20040715033232.GP25893@eumel.yoo.local>

Thorsten Haude wrote:

> - Is there any standard way to approach this problem? Has it come up
> before in other applications?

I don't know why you are even trying to normalize the paths like this. 
Just hand the thing off to the OS. Usually, both the user and the OS 
know what it is they are trying to do.

For your program to try to mediate between them, and try to "understand 
and correct" the user's request is almost always inappropriate.

Don't even try to normalize "\" to "/" or vice-versa. Windows APIs (the 
low-level ones) know perfectly well how to handle forward-slashes as 
directory separators..

> - Do you know a resource which explains how Posix apps are expected to
> handle paths like this?

It doesn't matter. Just pass the names, as is, to the underlying OS API.

POSIX specifically says that *two* leading slashes "implementation 
defined" behavior, and this is specifically to allow NetBIOS-like (and 
AFS-like) names in POSIX implementations.


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

