From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 820 invoked by alias); 2 Nov 2018 12:15:54 -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 578 invoked by uid 89); 2 Nov 2018 12:15:38 -0000 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 Received: from mail-eopbgr820114.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) (40.107.82.114) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Nov 2018 12:15:36 +0000 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= Received: from DM6PR04MB5211.namprd04.prod.outlook.com (20.178.24.208) by DM6PR04MB4092.namprd04.prod.outlook.com (20.176.87.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Fri, 2 Nov 2018 12:15:34 +0000 Received: from DM6PR04MB5211.namprd04.prod.outlook.com ([fe80::a4d6:a71d:7a68:68d7]) by DM6PR04MB5211.namprd04.prod.outlook.com ([fe80::a4d6:a71d:7a68:68d7%3]) with mapi id 15.20.1294.024; Fri, 2 Nov 2018 12:15:34 +0000 From: Ken Brown To: "cygwin@cygwin.com" Subject: Re: Stumbled upon relative name resolution across symlinks Date: Fri, 02 Nov 2018 12:15:00 -0000 Message-ID: <17c3c217-0b57-2976-a101-777ccf0e135b@cornell.edu> References: <123348672.20181102013908@yandex.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@cornell.edu; received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts) Content-Type: text/plain; charset="windows-1251" Content-ID: <2ADA4B65B9C07D4B9C54990443CAA504@namprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00027.txt.bz2 On 11/1/2018 6:39 PM, Andrey Repin wrote: > Greetings, All! >=20 > $ pwd > /home/anrdaemon/Documents/NIX/CA-tutorial/test >=20 > $ ls -ld bin ca-profile > lrwxrwxrwx 1 anrdaemon None 61 =ED=EE=FF 2 01:15 bin -> /home/anrdaemon= /Documents/NIX/CA-tutorial/svn-working/scripts > -rwx--x--x 1 anrdaemon None 588 =E4=E5=EA 24 2017 ca-profile >=20 > $ cat bin/../ca-profile > cat: bin/../ca-profile: No such file or directory >=20 > $ cat $( realpath -Le "bin/../ca-profile" ) > # @version $Id: ca-profile 82 2014-02-08 05:24:12Z anrdaemon $ > ... >=20 > 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/..'= =20 should resolve to the current working directory? This is not what Posix sa= ys.=20 See http://pubs.opengroup.org/onlinepubs/9699919799/, starting at "If a sym= bolic=20 link is encountered during pathname resolution...". The reason you got wha= t you=20 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