This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: Symlink'ed current directory and FIND
- To: <cygwin at cygwin dot com>
- Subject: Re: Symlink'ed current directory and FIND
- From: "Philip Sainty" <P dot Sainty at dtsp dot co dot nz>
- Date: Fri, 22 Dec 2000 19:40:10 +1300
- Organization: DTSP
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