public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Nellis, Kenneth" <Kenneth.Nellis@xerox.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE:  /bin/pwd -P doesn't expand all symlinks
Date: Fri, 23 Oct 2015 14:02:00 -0000	[thread overview]
Message-ID: <0D835E9B9CD07F40A48423F80D3B5A702E93D1BA@USA7109MB022.na.xerox.net> (raw)
In-Reply-To: <A209F3EB-2FC6-42AB-A4E0-B5A88C53DF4A@mac.com>

> 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

  reply	other threads:[~2015-10-23 12:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23  4:47 BUG: " Mark O'Keefe
2015-10-23 14:02 ` Nellis, Kenneth [this message]
2015-10-23 14:52   ` Mark O'Keefe
2015-10-23 21:27 ` BUG: " Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0D835E9B9CD07F40A48423F80D3B5A702E93D1BA@USA7109MB022.na.xerox.net \
    --to=kenneth.nellis@xerox.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).