delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/10/23/08:35:33

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-transfer-encoding
:mime-version; q=dns; s=default; b=ToOIAz+qu7sEosbnFIuTp+49e9kD+
pVScv+pbPKHT0J5pCleS1pVv/ObugInz1uzBflR6Cf3xU/ZIxSIYJXfG+7b+GKrx
w35pKKExRkdziOYDD1B1tTfU4UGZYNJb5JEItUX5VN5ANrcvetLFOuFPAptx+G7y
ojAQGXMgGHvDUc=
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-transfer-encoding
:mime-version; s=default; bh=+qfA8J5U0HyNnSzIR682vtcoj7s=; b=Lr2
3KypHc02wo5QG8K5+eEJQZ1hyyNejzpD7+kB0NjE6C/nQ5YimwRjDsf1gFNgXCox
tvkerHT/OaBOuDDAFzjKJ+euV8s1jZx79OjkqvYDuLoBXSuOJax790SbcDNm5N1x
BaN19gRVj+lpFWZJ0xnqDA1SXin+KSY04KW5+kvs=
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-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2
X-HELO: USA7109MR002.ACS-INC.COM
From: "Nellis, Kenneth" <Kenneth DOT Nellis AT xerox DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: /bin/pwd -P doesn't expand all symlinks
Date: Fri, 23 Oct 2015 12:35:01 +0000
Message-ID: <0D835E9B9CD07F40A48423F80D3B5A702E93D1BA@USA7109MB022.na.xerox.net>
References: <A209F3EB-2FC6-42AB-A4E0-B5A88C53DF4A AT mac DOT com>
In-Reply-To: <A209F3EB-2FC6-42AB-A4E0-B5A88C53DF4A@mac.com>
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t9NCZOsh011898

> From: Mark O'Keefe
> 
> Hi,
> 
> 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.
> 
> Cheers,
> Mark.

FWIW, WJJFM:

$ cd /tmp
$ /bin/pwd -P
/tmp
$ ln -s /home .
$ cd home
/tmp/home
$ /bin/pwd -P
/home
$ pwd
/tmp/home
$ mkdir dummy
$ cd dummy
/tmp/home/dummy
$ pwd
/tmp/home/dummy
$ /bin/pwd -P
/home/dummy
$ uname -srvmo
CYGWIN_NT-6.1 2.2.1(0.289/5/3) 2015-08-20 11:42 x86_64 Cygwin
$

--Ken Nellis

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