On 06/13/2010 09:17 AM, James Youngman wrote:
> On Sun, Jun 13, 2010 at 3:24 PM, Peng Yu <[email protected]> wrote:
>> I know that 'find' start from a dir then recursively check subdirectories.
>>
>> But I have an application, in which I need to check the start
>> directory first then check the parent directory (I want to control
>> whether to go to sibling directories) then the grandparent directory
>> (I want to control whether to go to sibling directories of the parent
>> directory).
>>
>> More general, thinking of the filesystem as a tree, I want to traverse
>> it starting from a non-root node and need some flexible rules to rule
>> out certain branches. I'm wondering if such a tool is available
>> somewhere?
> 
> I'm not aware of one, but such a thing would be relatively simple to
> code in Python or even Perl (which is probably why nobody wrote a
> dedicated tool).

tw looks like it might have enough of the kitchen sink to be able to
filter directories based on contents of the directory, maybe.
http://www2.research.att.com/~gsf/man/man1/tw.html

It still remains to be seen whether the next revision of POSIX will
require tw, but it still seems like it would be an interesting project
to add to findutils.

-- 
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to