This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
RE: /bin/pwd (getcwd) and symlinks
- To: "Cygwin mailing list" <Cygwin at Sourceware dot Cygnus dot Com>, "Earnie Boyd" <earnie_boyd at yahoo dot com>, "Egor Duda" <cygwin at sources dot redhat dot com>
- Subject: RE: /bin/pwd (getcwd) and symlinks
- From: "Andrej Borsenkow" <Andrej dot Borsenkow at mow dot siemens dot ru>
- Date: Wed, 18 Oct 2000 17:27:35 +0400
>
> Wednesday, 18 October, 2000 Earnie Boyd earnie_boyd@yahoo.com wrote:
>
> EB> --- Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru> wrote:
> >> If a current directory is symlink, getcwd() on Unix returns directory, to
> >> which this symlink points, while on Cygwin it returns directory itself:
> >>
> >> while on Unix this returns /tmp/real.
> [...]
> EB> It's implementation depedant. On my HP-UX system it returns
> the symbolic link
> EB> name. I could find no documentation stating that it should
> return the actual
> EB> directory.
>
> are you sure you've run "/bin/pwd"? Some shells (including bash) have
> internal pwd, which prints "symlinked" name.
>
:-)))
Yep. Speaking about "some shells" - it was exact reason why I noticed it. Zsh
has chaselinks option that forces built-in pwd command resolve symbolic links.
This option has no effect on cygwin because getcwd always returns symbolic
link.
To avoid using getcwd we'd need to reimplement cygdrive handling in zsh. Makes
no sense.
-andrej
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com