Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <39EDA52A.296E75B9@cygnus.com>
Date: Wed, 18 Oct 2000 15:27:06 +0200
From: Corinna Vinschen <vinschen@cygnus.com>
Reply-To: cygwin <cygwin@sources.redhat.com>
X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.14-SMP i686)
X-Accept-Language: de, en
MIME-Version: 1.0
To: Cygwin mailing list <Cygwin@Sourceware.Cygnus.Com>
Subject: Re: /bin/pwd (getcwd) and symlinks
References: <20001018124405.9125.qmail@web112.yahoomail.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Earnie Boyd wrote:
> 
> --- 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:
> >
> > mw1g017@MW1G17C% ls -l . sub
> > .:
> > total 0
> > drwxr-xr-x   2 mw1g017  ITS             0 Oct 18 15:40 real
> > drwxr-xr-x   2 mw1g017  ITS             0 Oct 18 15:40 sub
> >
> > sub:
> > total 1
> > lrw-r--r--   1 mw1g017  ITS            18 Oct 18 15:40 fake -> ../real
> > mw1g017@MW1G17C% cd sub/fake
> > mw1g017@MW1G17C% /bin/pwd
> > /tmp/sub/fake
> >
> > while on Unix this returns /tmp/real.
> >
> > Is it intentional?
> >
> 
> It's implementation depedant.  On my HP-UX system it returns the symbolic link
> name.  I could find no documentation stating that it should return the actual
> directory.

And it's intentional as well. In earlier versions we had problems with
`find' if you had a structure like that:

	/
	/etc
	/usr
	/usr/etc -> linked to /etc
	/usr/lib

A find in /usr resulted in some senseless warning messages due to
the way `find' examines and changes thru the directory structure.

This is solved by the current implementation of chdir()/getcwd().

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                        mailto:cygwin@sources.redhat.com
Red Hat, Inc.
mailto:vinschen@cygnus.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

