in reply to Re^2: Quick file search
in thread Quick file search

The lack of unix "find" utility is enormous

I'm wondering what you mean by that. There are windows ports of "find" available (google "unix tools for windows"); the ATT Research Labs version and the cygwin version are both authentically "unix-like" (or maybe "gnu-ish" is the better term).

"tree" filtered results solve to some extent this problem

Oh yes. That seems consistent with what I've seen in the unix domain -- about a 5- or 6-to-1 speed ratio comparing File::Find to "find". For really big directory trees, that multiplier becomes devastatingly significant.

Replies are listed 'Best First'.
Re^4: Quick file search
by jplindstrom (Monsignor) on Jan 05, 2006 at 12:26 UTC
    One thing to note is that you need to put the Cygwin before Windows in the PATH for this to work, since there already is a "find" (although it's really a rather weak "grep") on the system.

    /J

Re^4: Quick file search
by sh1tn (Priest) on Jan 06, 2006 at 13:11 UTC
    No need for tool from the "outside" world, maybe just:
    my $search_what = shift || die "no search criteria provided\n"; my $search_where = shift; my $file = qr/\|(?!\+\S{3})(\s.*?)$argv/i; my $clean = qr/^\W+(.+?)\W+$/; $dir = -d $dir ? $dir : '.'; for(`tree /a /f $search_where`){ /(\\|\+)-{3}/ and $dir= $_ and next; if (/$search_what/) { s/$clean/$1/ for $_, $dir; $dir ? print "dir: $dir$/","file: $_$/$/" : print "dir: . $/","file: $_$/$/"; } }