delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT sources DOT redhat DOT com |
Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
Message-ID: | <002201c06be2$07efc970$9401a8c0@WEDGE> |
From: | "Philip Sainty" <P DOT Sainty AT dtsp DOT co DOT nz> |
To: | <cygwin AT cygwin DOT com> |
Subject: | Re: Symlink'ed current directory and FIND |
Date: | Fri, 22 Dec 2000 19:40:10 +1300 |
Organization: | DTSP |
MIME-Version: | 1.0 |
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 AT cs DOT cornell DOT 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |