From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95625 invoked by alias); 13 Feb 2017 15:16:21 -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 95614 invoked by uid 89); 13 Feb 2017 15:16:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-101.6 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=how's, hows, Hx-languages-length:1725, H*MI:sk:6055a8e X-HELO: drew.franken.de Received: from mail-n.franken.de (HELO drew.franken.de) (193.175.24.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Feb 2017 15:16:18 +0000 Received: from aqua.hirmke.de (aquarius.franken.de [193.175.24.89]) (Authenticated sender: aquarius) by mail-n.franken.de (Postfix) with ESMTPSA id 032B4721E280C for ; Mon, 13 Feb 2017 16:16:15 +0100 (CET) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id 44E9F5E00DF for ; Mon, 13 Feb 2017 16:16:14 +0100 (CET) Received: by calimero.vinschen.de (Postfix, from userid 500) id 2F188A8055A; Mon, 13 Feb 2017 16:16:14 +0100 (CET) Date: Mon, 13 Feb 2017 15:16:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: cygpath -w converts relative paths to absolute windows paths Message-ID: <20170213151614.GA25846@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <10eb657d-a00b-1609-a9b9-6373092c1ac1@polyhack.io> <20170212112314.GE11666@calimero.vinschen.de> <6055a8e1-bfd7-16c7-f25a-e02523863fdd@towo.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <6055a8e1-bfd7-16c7-f25a-e02523863fdd@towo.net> User-Agent: Mutt/1.7.1 (2016-10-04) X-SW-Source: 2017-02/txt/msg00169.txt.bz2 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1728 On Feb 12 18:38, Thomas Wolff wrote: > Am 12.02.2017 um 12:23 schrieb Corinna Vinschen: > > On Feb 7 14:35, Roger Qiu wrote: > > > Hi, > > >=20 > > > I've found that `cygpath --windows '../` will give back an absolute w= indows > > > path. > > >=20 > > > I thought this would only happen if you provide the `--absolute` flag= , or > > > when the path is a special cygwin path. > > >=20 > > > But this occurs just for normal directories. > > >=20 > > > 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. > > >=20 > > > Can `cygpath --windows '../directory'` give back `..\directory` for p= aths > > > aren't special cygwin paths? These relative backslashes are supported= in > > > Windows right now. > > Not easily. All paths are evaluated as absolute paths inside Cygwin. > > The result of the path conversion is always an absolute path. A relative > > path is generated from there by checking if the path prefix in POSIX > > notation is identical to the current working directory. If not, the > > path stays absolute. Naturally, if you use a "..", the resulting path > > does not match the CWD anymore, so you're out. > How about converting getcwd(), too, and comparing that? Converting to what? And how's that different from what I describe above? Btw., did you see https://cygwin.com/ml/cygwin/2017-01/msg00404.html? Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYoc2+AAoJEPU2Bp2uRE+gqs8P/R5w92A8Q+uKYCvR5h9cRJPW ct2Soj0dw+eKQYRyW7Fc323zHd3IhiHT7ng6nmyG/+sdSdmJ4Qs3iCMfFxgBbvNO QPLm6NEfMdgdbHDexSz+gfataTtgp8GVXMBAgJaMoxn1EXYTeUefDz0EA5PYmKOf wFWEd1GOfSURD40t8vYJuG1LmYkbHRDZaN0dxKZ46PYo12RX32jZwCoOKhIOoH7B /XxQJr8geMCIvs5H7vngUlbULf2AYvt1uxnbhYvQqsdD9/rdjqiTIfGc9ECIcgwY T3zAmKdJ1dnge/2sP4K3k0Xw8UaOfC0A9STLeOn3SWrzlrW2TdrehC7rtT0tjEbh QB32tB4HyuxjKdBdZnbJ4uJb50KRplzP3laykHyoyVqxjR+DXlK6owIW8xej5JT1 g4iPov3GGqUZZWVJ+N/uadGNNKr7aMedv3V727iJ3qC7CuMIotf6G1qFi/VKQFWV JuTi1hdG0Z6dhXqutkE1/mZkSVpp/RvgQZchoGYJqW2WArQcTK6hpOHMDRJcq84z kT3dj3SrwVFOYOIb6bDEMQKfrEHtX9oX2lXZW8OzIUxRXs9Ygh8tDLmijqNnJu5R 9RuJ5LcoHL1xurvpvroX3YxPqWMqB1KoUarEhUd7kZRyKYzHaLXpJEorff0KZRLv aOiCrIPcHFRo99aHLDtf =/4cR -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--