delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/02/08/20:17:48

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=hvoopsjmBb+Iccar
lB/AMhqcw92QZHsV2GDyJlwPXsXDvjLGvTeN4I2SdII0BwOwT7n5pD3kYTxZTcSj
bgHtsPS5bTeeajtzZpVo1ugtNMndfe+KSFFpnYF/E8tEQ2/yqjhc2ZYk7EWCdYzc
L2awvVAb9WHC/mIFeVBFE7tYvS4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=xZDAqxgtdvqPvOBovLs9sp
rg+Fw=; b=B233Ou2Rvq4RVM0Wj3lxAc65tLU0fQcGv3hKoL1Tjrt7zaPMrgMK/P
IFXP6k1lC8kQqQfdXiJo/ZfIgf4SPnpMa24UfAgf+9jOpcoX6oFzsoVwNYe0x6DU
WBzf1b8uGKsVB+qMWZcWWdiLZlL/dhDVi2E0Q9BW5IpsnshpUrTs4=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=founder, Hx-languages-length:1804, H*MI:sk:3576142, Founder
X-HELO: mail-pf0-f172.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=nWA24GZU7Cr80n2wHB4sY5v0o7AnFrtXA2tX09GBQVI=; b=DvXWL0mUOmUvqnNyc5+x8uRxthc2h1o0ssvFEW1/dLqV8da4HgnxycW79eUs7hjcLc dfZPJ2d1ToRn/5pVSHO2jPhRg6G2xv19vw68f0ljj9J7e+lIDQ/RyFaq6OVTN/WOL+SZ a08O0zf4lG4vKwCuDYuYoKr0O2vsDZg5vU+0VKRPbhvBIem6m2RL18c7z0chFlIhNScN 5etjLUJaXnmooyGyBbk5tgSqbvyuPGndR0nRUgjQDg0zD+tB0NYL9Qy0L+1Hz+SYAFol rK2bKHLm/VvobdDWEb1JA45ny2JepgjJaMsS3YP7nCtCQmQ1/ieGRKgi+WLtG8kaNEjA DRvg==
X-Gm-Message-State: AMke39la6jRPVpN8AWD+9uqJFbRHaUjMD53vp2zAIW4i9iaZ2Xld1f+Ogf/D3DU2NjtJOg==
X-Received: by 10.98.86.68 with SMTP id k65mr589960pfb.13.1486603040364; Wed, 08 Feb 2017 17:17:20 -0800 (PST)
Subject: Re: cygpath -w converts relative paths to absolute windows paths
To: cygwin AT cygwin DOT com
References: <10eb657d-a00b-1609-a9b9-6373092c1ac1 AT polyhack DOT io> <357614277 DOT 20170207183005 AT yandex DOT ru>
From: Roger Qiu <roger DOT qiu AT polycademy DOT com>
Message-ID: <76fd8907-7b47-b40c-d259-20c80355c8df@polycademy.com>
Date: Thu, 9 Feb 2017 12:17:13 +1100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
MIME-Version: 1.0
In-Reply-To: <357614277.20170207183005@yandex.ru>

Hi Andrey,

That was probably true in the past, but no longer!

I just tested this: `mklink /D testlink "..\All Users"` in cmd and then 
I went to Cygwin ZSH, and ran `ll`.

This showed me: `testlink -> '../All Users'/`.

Up one directory relative links do work on Windows! This is a directory 
symbolic link, which is superior to directory junctions.

Regardless of directory junction support (which I didn't test), I think 
`cygpath` should give the right results, when I don't specify an 
absolute path, I really mean give me the windows version of the relative 
path.

Now maybe there's some backwards compatibility issues, then perhaps a 
flag that can be set to mean `--really-relative`.

Thanks,

Roger

On 8/02/2017 2:30 AM, Andrey Repin wrote:
> Greetings, Roger Qiu!
>
>> Hi,
>> I've found that `cygpath --windows '../` will give back an absolute
>> windows path.
>> I thought this would only happen if you provide the `--absolute` flag,
>> or when the path is a special cygwin path.
> ".." is a special path, that can't be safely converted.
> In all cases, using absolute path is preferred for many reasons.
>
>> But this occurs just for normal directories.
>> I have come across a situation where I need to convert ntfs symlinks to
>> unix symlinks and back. Sometimes these symlinks have relative paths
>> them. Now by using cygpath --windows, I get back absolute paths, which
>> means the integrity of the symlink isn't preserved.
>> Can `cygpath --windows '../directory'` give back `..\directory` for
>> paths aren't special cygwin paths? These relative backslashes are
>> supported in Windows right now.
> AFAIK, Windows do not support relative junction points.
>
>

-- 
Founder of Polycademy
http://polycademy.com/
+61420925975


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