From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15155 invoked by alias); 23 Oct 2015 15:05:14 -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 14586 invoked by uid 89); 23 Oct 2015 15:05:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=4.1 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.ht-systems.ru Received: from smtp.ht-systems.ru (HELO smtp.ht-systems.ru) (78.110.50.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 23 Oct 2015 15:05:11 +0000 Received: from [95.165.144.62] (helo=darkdragon.lan) by smtp.ht-systems.ru with esmtpa (Exim 4.80.1) (envelope-from ) (Authenticated sender: postmaster@rootdir.org) id 1Zpdtv-0006xo-Ps ; Fri, 23 Oct 2015 18:05:03 +0300 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Fri, 23 Oct 2015 14:53:19 -0000 Date: Fri, 23 Oct 2015 21:27:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <854501859.20151023175317@yandex.ru> To: Mark O'Keefe , cygwin@cygwin.com Subject: Re: BUG: /bin/pwd -P doesn't expand all symlinks In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00415.txt.bz2 Greetings, Mark O'Keefe! > While using /bin/pwd -P to expand directories to get the absolute, > non-symlinked version of the directory I discovered that this doesn't work > on Cygwin as I believe it is meant to work. > $ cd /tmp > $ /bin/pwd -P > /tmp > $ ln -s /home . > $ cd home > $ /bin/pwd -P > /home > $ pwd > /tmp/home > $ mkdir dummy > $ cd dummy > $ pwd > /tmp/home/dummy > $ /bin/pwd -P > /tmp/home/dummy > NOTE: That last command should have returned "/home/dummy". It hasn't > expanded the parent symbolic link as you would have expected it to do. > For what I'm doing I need the physical path, not the symbolic path (which is what the -P is meant to provide). > Please confirm if I'm correct in my understanding? I've tested this on > Ubuntu and it works as I'd expect it... > Now having to create an alternative approach to get the correct answer > while I wait for this to be fixed (assuming it is a bug as I believe it is). > Thanks in advance for any help in resolving this. There's some juju with native symlink expansion going on. I vaguely recall that it was done for speed. But the results really seems non-expected. C:\arc is a symlink to the \\daemon1\arc shared directory. $ cd /c/arc/ anrdaemon@daemon2:/c/arc $ /bin/pwd.exe -P //DAEMON1/arc anrdaemon@daemon2:/c/arc $ /bin/readlink.exe -fe . //DAEMON1/arc All is well. anrdaemon@daemon2:/c/arc $ cd images/ anrdaemon@daemon2:/c/arc/images $ /bin/pwd.exe -P /c/arc/images anrdaemon@daemon2:/c/arc/images $ readlink -fe . /c/arc/images Not expected. But here we are going to real surprise: anrdaemon@daemon2:/c/arc/images $ readlink -fe $(pwd) //DAEMON1/arc/images -- With best regards, Andrey Repin Friday, October 23, 2015 17:46:32 Sorry for my terrible english... -- 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