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=Ew9re6LTSH+5xBA1 WER8crQPiZCvPiscjkUYXh19chrZPtt6BVKj822dPVxyNcaRAySo2sryJSQBQDSK m/RnSSfNfxrRYLon/+M9yVK7vPk2djLkvQI172lLApDOy9La8ctPFlUgoTn7dMpv EXn2xvDFJWpQnjsQhS22b9pPitw= 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=/zarulCZTDsJXrIUfLKRnd VXKcU=; b=Dclomym/CQnyy5bL9eXm0o4nk/knju8wTayx++P7CV74omK8Q8GO/h 4WaG8QOFXW/MytkLdaCP5zbylnqHhXemzdhqaXf4eUm/4pbIJH86H/3KgzaXO6Ox yZ7qXh5yEVF3AHnPOQHzXG65cIQgXEjSOXDFRM9zOPTjJb5xtJlEg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-0.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=getcwd, H*RU:sk:mrelaye, Hx-spam-relays-external:sk:mrelaye X-HELO: mout.kundenserver.de 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> <20170212112314 DOT GE11666 AT calimero DOT vinschen DOT de> From: Thomas Wolff Message-ID: <6055a8e1-bfd7-16c7-f25a-e02523863fdd@towo.net> Date: Sun, 12 Feb 2017 18:38:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170212112314.GE11666@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-UI-Out-Filterresults: notjunk:1;V01:K0:sNf1k7ryi7A=:UI9KwZVid5iSLWXHMtyHQe t8/rY3zaS6G1htvZfuKKhXTz+K5JT1A1KzC5f63LSydn0gq3UApfUQwbqkGDG/NpqPKE4fQSR zq7OQdfXdGc8w/bdWv3AVsww77uCMy9AAcOUVgyb6V4DiXs0XZ7Hx4Mvh0NDuqhlly7lVnfgM zL8nJV38qLi0KZYNeTf/KbKJHon42kz8milFx2n3DmVvSk5LyaIJ7rIBd2x2ITWGR7lYJmYm5 Yj2gnh+6Dvc33soYBWQmXg3aOEFgOYgOYoiD12/Q2CgH2SdXfcK9n+Tnnb/l1FF82BAOJmO+o HMOM6wMJ6xmQfIYcMVtrBFwPxXWDGaRT7ec+TrqA4qJbsCoAdlz3Y64U8ALtWOIhgT/YZwBlA GgfzKFo6WO5i2ejTuNKdxeJm24XMBUhNxEtIRNT688SKQxr8kqgnrzkElKBNB9bEB1S34DzLP 2n5lAEMooMm1LJzkAx/rivffFM+alGu9cgwrsE5c0giQZ9egLpRJ5B87QpYtzNJwrOtCwHGQh juN9uUU14pIupabU+1C93FXwnGqN1QlJJ53R5jg5Od1wPhq8z2AcQK3Y1ajT7b+XX5mHK1rfE 1LAuzf3ZXuMSNla/Ykb+Xyk2C/etvyFfoMqFcUGd4kTvlk9YA759XMU0220zRIsXhF2cxdtU8 9FnOdWl4Fwom40aUmbrh/2D8Xcc01dbW9TwymVLX1Ou7X3b592IN42CkFzgu969eqw8dn8ZNZ Jq1C4tDEOVcFM2K3 X-IsSubscribed: yes Am 12.02.2017 um 12:23 schrieb Corinna Vinschen: > On Feb 7 14:35, Roger Qiu wrote: >> 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. >> >> 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. > 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? ------ Thomas -- 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