delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/11/02/08:16:15

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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; q=dns; s=default; b=F1zveOwT2cspV8xS4iF4GNhFY5Quz
7iaYFw6bcIzyeFH5IK58AszYvVGLZ8dqsBCKTDfvqXpvKZxHhq7vR7N+PP5b3pdC
ofeFCQAwTu+wjoURFOv6bachedJR2bO/XUArtlIKeQRY9W+i73Nrax2xiOpaKkhE
7CbSuY6EWKkVfU=
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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; s=default; bh=NnZM7IvI/0acwnpjO8t8BXh1lRU=; b=AYy
9uQeexksU0VPflgV4XZioUiXZaf40/yldbXAyuaEJ7VMC+E2uAuGaXG55yn31aIG
qrZLs/Bayc70EuT+Ky4JyhuYlyP8KXQUe7r0wXFOa59VJPOflu0vpKD5r3afkC6O
NUoTMJSCaTdxQlqeGxDeDpRVpSlneCKJCHivteFg=
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-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_50,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Repin, Andrey, andrey, repin
X-HELO: NAM01-SN1-obe.outbound.protection.outlook.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=edP4ETFPJSdkZOU62YDJ6oEcFcyvGJhqozkFfryquy4=; b=HdWpKCsNpRprjZBRHS63ur5X7U5tWebh3SlasJsPPcL9bgRRUeFxQAVW8+0/gEFevkkIGxLg3r9maBedxKkEuzwWtpOICt21/L7HQRtkZKskiCKHoALMv8DNXalXKNVvcYSMwiUZESLsG+Fk+gNkAZ++vjS8dOjbZdxonRQVSIk=
From: Ken Brown <kbrown AT cornell DOT edu>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: Stumbled upon relative name resolution across symlinks
Date: Fri, 2 Nov 2018 12:15:34 +0000
Message-ID: <17c3c217-0b57-2976-a101-777ccf0e135b@cornell.edu>
References: <123348672 DOT 20181102013908 AT yandex DOT ru>
In-Reply-To: <123348672.20181102013908@yandex.ru>
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu;
received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts)
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id wA2CGBP7027375

On 11/1/2018 6:39 PM, Andrey Repin wrote:
> Greetings, All!
> 
> $ pwd
> /home/anrdaemon/Documents/NIX/CA-tutorial/test
> 
> $ ls -ld bin ca-profile
> lrwxrwxrwx 1 anrdaemon None  61 ноя  2 01:15 bin -> /home/anrdaemon/Documents/NIX/CA-tutorial/svn-working/scripts
> -rwx--x--x 1 anrdaemon None 588 дек 24  2017 ca-profile
> 
> $ cat bin/../ca-profile
> cat: bin/../ca-profile: No such file or directory
> 
> $ cat $( realpath -Le "bin/../ca-profile" )
> # @version $Id: ca-profile 82 2014-02-08 05:24:12Z anrdaemon $
> ...
> 
> In simpler words, the bin directory is symlinked from elsewhere.
> realpath -Le resolves correctly, but all other filesystem functions fail.

I might be misunderstanding you, but are you saying that you think 'bin/..' 
should resolve to the current working directory?  This is not what Posix says. 
See http://pubs.opengroup.org/onlinepubs/9699919799/, starting at "If a symbolic 
link is encountered during pathname resolution...".  The reason you got what you 
wanted using 'realpath -L' is that the -L option specifically asks for that:

$ man realpath
[...]
        -L, --logical
               resolve '..' components before symlinks

Ken

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