delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/06/23/11:20:44

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: Yes, hits=6.1 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,FSL_RU_URL,KAM_THEBAT,TW_YG
X-Spam-Check-By: sourceware.org
Date: Thu, 23 Jun 2011 19:05:34 +0400
From: Andrey Repin <anrdaemon AT freemail DOT ru>
Reply-To: Andrey Repin <cygwin AT cygwin DOT com>
Message-ID: <1144668147.20110623190534@mtu-net.ru>
To: Marco atzeri <marco DOT atzeri AT gmail DOT com>, cygwin AT cygwin DOT com
Subject: Re: Strange cygpath behavior.
In-Reply-To: <4E03492D.40109@gmail.com>
References: <73619422 DOT 20110621092310 AT mtu-net DOT ru> <4E00321A DOT 30105 AT lysator DOT liu DOT se> <92658329 DOT 20110623165230 AT mtu-net DOT ru> <4E03492D DOT 40109 AT gmail DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Greetings, Marco atzeri!

>>>> I'm facing an unacceptable cygpath behavior related to the network shares.
>>
>>> Unacceptable?
>>
>> Exactly.

> Unacceptable seems a moral judgement, for this reason
> I guess Peter is perplexed.

>>
>>> Perhaps your quoting skills and expectations fall
>>> into that category...
>>
>>>> The testcase is:
>>>>
>>>> [\\DAEMON1\anrdaemon]$cygpath -u \\DAEMON1\anrdaemon\.profile
>>>> //DAEMON1/anrdaemon/.profile
>>
>>> I think you mean cygpath -u \\\\DAEMON1\\anrdaemon\\.profile
>>
>> No, I did mean what I wrote.

> What about a more clear explanation of what do you expect
> to obtain ?

Me? I expect to be able to use Cygwin utilities in Windows environment.
As supposed to... to my best knowledge.

> I have problem to understand your problem,
> while Peter answer seems more obvious (to me).

Problem is that path detection/conversion does not work for network paths.

> Problem reports:       http://cygwin.com/problems.html

> In general the "\" is used as escape character so unquoted
> it just preserves the next character

> \\DAEMON1\anrdaemon\.profile
> is equivalent to
> "\DAEMON1anrdaemon.profile"

Try it yourself, as well as what Peter tried to suggest (or "correct" me).
Neither is working straight.
Just for example:
$ cygpath -u \\\\DAEMON1\\anrdaemon\\.profile
/c/DAEMON1/anrdaemon/.profile

Or, before we get lost, try to make this simple and widely used construction
work straight:

#! /bin/sh
XXX=${XXX:=$(readlink -fn "$0")}
XXX=$(dirname "$XXX")
ls -l "$XXX"

Cygwin, to my best understanding, is supposed to transparently accept native
Windows paths.
And, say,
diff "%USERPROFILE%\.profile" "someotherprofile\.profile"
works... as long as it's a local path (including mapped drives).
Network paths break instantly.


--
WBR,
 Andrey Repin (anrdaemon AT freemail DOT ru) 23.06.2011, <18:47>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019