Mail Archives: cygwin/2011/06/24/04:51:53
X-Recipient: | archive-cygwin AT delorie DOT com
|
X-SWARE-Spam-Status: | No, hits=0.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FREEMAIL_REPLY,FSL_RU_URL,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_YG
|
X-Spam-Check-By: | sourceware.org
|
Message-ID: | <4E045008.7030607@gmail.com>
|
Date: | Fri, 24 Jun 2011 10:51:20 +0200
|
From: | Marco atzeri <marco DOT atzeri AT gmail DOT com>
|
User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
|
MIME-Version: | 1.0
|
To: | Andrey Repin <cygwin AT cygwin DOT com>
|
Subject: | Re: Strange cygpath behavior.
|
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> <1144668147 DOT 20110623190534 AT mtu-net DOT ru> <4E035F46 DOT 7000207 AT gmail DOT com> <1291997550 DOT 20110623220605 AT mtu-net DOT ru>
|
In-Reply-To: | <1291997550.20110623220605@mtu-net.ru>
|
X-IsSubscribed: | yes
|
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm
|
List-Id: | <cygwin.cygwin.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
|
On 6/23/2011 8:06 PM, Andrey Repin wrote:
> Greetings, Marco atzeri!
>
>> On 6/23/2011 5:05 PM, Andrey Repin wrote:
>>> Greetings, Marco atzeri!
>>>
>>> Cygwin, to my best understanding, is supposed to transparently accept native
>>> Windows paths.
>
>> No, cygwin expects to receive POSIX/Unix paths
>
>> $ cygpath -h
>> [cut]
>> -u, --unix (default) print Unix form of NAMEs
>> (/cygdrive/c/winnt)
>
>> so cygpath -u
>> expects to receive a Windows path and convert it in a unix one.
>
> That's your assumption. Which is not necessarily true. (Unless you're author
> of cygpath, in which case you have full authority to tell me what it is
> supposed to be.)
> Man page and reference card both do not specify the exact argument format,
> only the intended result format.
> And just to be clear, windows in the core don't see a difference between the
> path in format of "C:/whatever/..." or "C:\whatever\...".
> This behavior is very, very old. Even older than Windows itself, if you know,
> what "INT 21h" means.
you are right, but it is not very useful to translate a
windows path in a windows path ...
On Win XP cmd.exe, is not always true that the
two forms are equivalent (we are not anymore on CP/M, DOS age):
C:\Temp>cd c:/Temp
The system cannot find the path specified.
C:\Temp>cd c:\Temp
C:\Temp>
C:\>cd c:\Temp
C:\Temp>
C:\>cd c:/Temp
C:\Temp>
and if I remember correctly also somewhere else in the core of MS system
the "\" "/" are not equivalent.
>
>> From your example:
>> cygpath -u \\\\DAEMON1\\anrdaemon\\.profile
>> /c/DAEMON1/anrdaemon/.profile
>
>> the argument is an escaped windows network path
>> and the outcome is the Unix equivalent
>
> Not true for the "outcome" part.
>
> <stdout>:cygpath -w "/c/DAEMON1/anrdaemon/.profile"
> C:\DAEMON1\anrdaemon\.profile
With your cygdrive mapping /c is the disk C: so the first looks like a
Unix path and the outcome is the equivalent windows path.
Cygpath doesn't check if the path exist
From my bash shell, as cygdrive is not remapped:
$ cygpath -w "/c/DAEMON1/anrdaemon/.profile"
E:\cygwin2\c\DAEMON1\anrdaemon\.profile
$ cygpath -w "/cygdrive/c/DAEMON1/anrdaemon/.profile"
C:\DAEMON1\anrdaemon\.profile
>
> Which is far from original network path.
>
>> As Corinna explained:
>> $ echo \\\\DAEMON1\\anrdaemon\\.profile
>> \\DAEMON1\anrdaemon\.profile
>
> I already said that I'm sorry, that I forgot to mention what seems to be
> critical bit of information.
>
>> By the way resetting "cygdrive" is not a good idea,
>> it is better to obtain
>
> To tell you, that was actually a good idea for me. I don't have an eternity to
> type "/cygwhatever" every time I want to address another drive. So the idea
> to map cygdrive to "/" was actually very handy, thanks to this mailing list
> helping to finish and polish it.
If you are happy, fine for me.
> --
> WBR,
> Andrey Repin (anrdaemon AT freemail DOT ru) 23.06.2011,<20:58>
>
> 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 -