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: <002201c06be2$07efc970$9401a8c0@WEDGE>
From: "Philip Sainty" <P.Sainty@dtsp.co.nz>
To: <cygwin@cygwin.com>
Subject: Re: Symlink'ed current directory and FIND
Date: Fri, 22 Dec 2000 19:40:10 +1300
Organization: DTSP
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700


Wed, 15 Nov 2000 06:35:15 -0800 (PST)
Earnie Boyd <earnie_boyd at yahoo dot com> wrote:
>
> --- Paul  Stodghill <stodghil@cs.cornell.edu> wrote:
> > Why doesn't FIND find files in the current directory when the current
> > directory is accessed via a symlink?
> >
>
> Find doesn't dereference symbolic links unless you tell it to.  The
command
>   find -follow -type f
> would display the files you want displayed.

Not necessarily... I just noticed this when trying to find
real directories under a symlinked directory. Naturally
I don't want other symlinks to appear, so -follow doesn't
help. Rather unfortunate behaviour. It would certainly
be nice if this was changed to match other versions
of find.

It doesn't seem like it would be too difficult, seeing as
how test is able to make the required distinction:

$ ln -s <dir> foo
$ find foo -type l
foo
$ find foo/. -type l
foo/.
$ if test -L foo ; then echo link; fi
link
$ if test -L foo/. ; then echo link; fi
$


Is it too simplistic to imagine that a call to test (or the
relevant code thereof) be made in find to determine
whether the given path is actually a symlink? It only
needs to happen once per find, so wouldn't cause
much of a hit on performance.


cheers,
-Philip




--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

