From mboxrd@z Thu Jan 1 00:00:00 1970
From: "Philip Sainty"
To:
Subject: Re: Symlink'ed current directory and FIND
Date: Thu, 21 Dec 2000 22:41:00 -0000
Message-id: <002201c06be2$07efc970$9401a8c0@WEDGE>
X-SW-Source: 2000-12/msg01050.html
Wed, 15 Nov 2000 06:35:15 -0800 (PST)
Earnie Boyd wrote:
>
> --- Paul Stodghill 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 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