From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50695 invoked by alias); 9 Feb 2017 01:17:33 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 50676 invoked by uid 89); 9 Feb 2017 01:17:32 -0000 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 Received: from mail-pf0-f172.google.com (HELO mail-pf0-f172.google.com) (209.85.192.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Feb 2017 01:17:22 +0000 Received: by mail-pf0-f172.google.com with SMTP id f144so45644909pfa.2 for ; Wed, 08 Feb 2017 17:17:22 -0800 (PST) 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) Received: from [192.168.15.13] (mad2538451.lnk.telstra.net. [110.145.85.183]) by smtp.gmail.com with ESMTPSA id l188sm23324400pfl.28.2017.02.08.17.17.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Feb 2017 17:17:19 -0800 (PST) Subject: Re: cygpath -w converts relative paths to absolute windows paths To: cygwin@cygwin.com References: <10eb657d-a00b-1609-a9b9-6373092c1ac1@polyhack.io> <357614277.20170207183005@yandex.ru> From: Roger Qiu Message-ID: <76fd8907-7b47-b40c-d259-20c80355c8df@polycademy.com> Date: Thu, 09 Feb 2017 01:17:00 -0000 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> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00115.txt.bz2 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