This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: error in "cygpath" behavior
- From: Thomas Wolff <towo at towo dot net>
- To: cygwin at cygwin dot com
- Date: Sat, 1 Sep 2018 09:17:21 +0200
- Subject: Re: error in "cygpath" behavior
- References: <5b88c605.1c69fb81.f383.a0b6@mx.google.com> <20180831085734.GF6350@calimero.vinschen.de> <5f5472d0-bdee-56d0-7549-41e83d48e6bc@gmail.com> <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