public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Thomas Wolff <towo@towo.net>
To: cygwin@cygwin.com
Subject: Re: error in "cygpath" behavior
Date: Sat, 01 Sep 2018 07:17:00 -0000	[thread overview]
Message-ID: <dfa55fc0-7679-cb7f-f978-5a7e73ebdfd4@towo.net> (raw)
In-Reply-To: <ad34f7a7-ec71-de69-b2d2-711c2e8d61b0@redhat.com>

Am 31.08.2018 um 22:05 schrieb Eric Blake:
> On 08/31/2018 02:48 PM, cyg Simple wrote:
>
>>
>> Don't forget the possibility that '..' points to a symlink which Windows
>> will not understand.
>>
>> $ mkdir -p /foo/baz
>> $ ln -s /foo /bar
>> $ cd /bar/baz
>> $ cygpath -w ..
>
> Except .. never points to a symlink.  It always points to the physical 
> directory that contains the current directory (that is, /foo, not 
> /bar).  The shell can maintain a notion of a logical current directory 
> (based on whether you use 'set -P' for physical or 'set +P' for 
> logical; where bash defaults to +P), and in that mode, 'cd ..' behaves 
> logically (acting as though you are now in /bar, rather than actually 
> changing you to /foo).  But that still doesn't change the fact that 
> '..' in file name resolution never resolves to a symlink, because the 
> shell is merely rewriting your ".." to avoid passing it on to the 
> syscalls, rather than the syscalls actually knowing about logical mode.
As a side-note, this is also the reason that you may be facing apparent 
inconsistency with path name completion,
like `ls ../[TAB]` suggesting you files and directories that do not 
exist once you run the command.
This is not cygwin-specific.

---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus


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

  parent reply	other threads:[~2018-09-01  7:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 15:29 Steven Penny
2018-08-31 19:36 ` Corinna Vinschen
2018-08-31 22:34   ` cyg Simple
     [not found]     ` <ad34f7a7-ec71-de69-b2d2-711c2e8d61b0@redhat.com>
2018-09-01  7:17       ` Thomas Wolff [this message]
     [not found]   ` <5b89c269.1c69fb81.84d1a.6f1b@mx.google.com>
2018-09-01  6:40     ` Achim Gratz
2018-09-01  6:54     ` Brian Inglis

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=dfa55fc0-7679-cb7f-f978-5a7e73ebdfd4@towo.net \
    --to=towo@towo.net \
    --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).