DragonFly BSD
DragonFly submit List (threaded) for 2005-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: grep --dont-read-devices-or-symlinks


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Sun, 19 Jun 2005 15:12:32 +0200
Mail-followup-to: submit@crater.dragonflybsd.org

On Fri, Jun 17, 2005 at 05:51:41PM +0200, Simon 'corecode' Schubert wrote:
> On 17.06.2005, at 15:47, Joerg Sonnenberger wrote:
> >>find attached a patch to grep to only read real files, ignoring 
> >>symlinks,
> >>devices, etc.(-O --only-files). I felt I need this for grepping my 
> >>/src/sys
> >>which also contains some compile/* directories where modules produce 
> >>recursive
> >>loops...
> >I'm more comfortable with fixing the recursion loops properly.
> 
> how so? i don't want to search a duplicate /sys at all... well, i can 
> keep the patch in my tree as well, just wanted to share some thought

Well, I think we have two options here. The first is to extend
--directories with a new option "skip-symlinks", which skips all
symlinks to directories. The second would be to keep a list of
(fsid, inode) from all the directories already processed. That
would be the full loop detection, but can slow down the processing
a lot.

Joerg



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]