From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23076 invoked by alias); 12 Feb 2017 11:23:19 -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 23068 invoked by uid 89); 12 Feb 2017 11:23:18 -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=Hx-languages-length:1327, backslashes, Naturally, ntfs 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; Sun, 12 Feb 2017 11:23:17 +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 EC21A721E281A for ; Sun, 12 Feb 2017 12:23:14 +0100 (CET) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id 56FF25E04B5 for ; Sun, 12 Feb 2017 12:23:14 +0100 (CET) Received: by calimero.vinschen.de (Postfix, from userid 500) id 3A9DDA80CD3; Sun, 12 Feb 2017 12:23:14 +0100 (CET) Date: Sun, 12 Feb 2017 11:23:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: cygpath -w converts relative paths to absolute windows paths Message-ID: <20170212112314.GE11666@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <10eb657d-a00b-1609-a9b9-6373092c1ac1@polyhack.io> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GZVR6ND4mMseVXL/" Content-Disposition: inline In-Reply-To: <10eb657d-a00b-1609-a9b9-6373092c1ac1@polyhack.io> User-Agent: Mutt/1.7.1 (2016-10-04) X-SW-Source: 2017-02/txt/msg00158.txt.bz2 --GZVR6ND4mMseVXL/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1323 On Feb 7 14:35, Roger Qiu wrote: > Hi, >=20 > I've found that `cygpath --windows '../` will give back an absolute windo= ws > 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 u= nix > 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 paths > 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. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --GZVR6ND4mMseVXL/ Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYoEWiAAoJEPU2Bp2uRE+gHucP+wRI1Ud2JJE/V29oOytrryHm C7mC002/n0n8oIzbu/9pJPwPuXvAHDokmNpTaO6n+ThAmLoTIka74q+OKOkdoiy3 IuLrlce3Kc2+JGIyCUQ7dCef0AmJq9yye0v3t4xqhi/zkJwMiQ+y1W5jmUiYpbIj Be88DrgW6S5/55+e58fDgphYffnJ4HwKPv2v2hLkc/5GCB6IJI1BZVK71wH9bp78 RX1jYy17FGRP+D6HGMSzd5s+/iBudj3Yzys4kA5yCpS/jJhHQ2agUX7/vRqkDFSS cBKpBpX/S9k7llRoq2ZqYA/bLP2JQmnz0a8QO7hTFJEpaTHnBQJK4igoANvI4rdA 3TVyV7l74EuSILhMr4rH1pUQ5Wj9gbtjZHIolsVffzVZ2X0UaKJwtbX1IxamtAPu KyStvmcLy87qPvRzNUzoNro83T7xf8+b/Izswo8aDkzKefNVnJhcGr7llxl6t0kI x+NoMD0+1T3Ucxkf9fjE8OjkT9bCP+0pcHNktHAjiG5KfRA7aw/pJVpfglBqLvlI 8RQv/mEoTMX/ZLbeU8CL1334UoobayhvR1ENGyAc22wx+rLXnriJctUlnqPzEl1m 4rqa9519ymgHku/61iPH0G3jV6/knpj4vY2VWS0Y2EppFzGp6+ZLnfx7fltYOgdq ogtQRo1qPwVaHJ3Vl6HF =/5Mw -----END PGP SIGNATURE----- --GZVR6ND4mMseVXL/--