in reply to Quick file search
The only problem with the OP code is that you have to remember to run "tree" yourself -- and save its output in a specific file whose name is hard-coded in your perl script -- before running the script, so that you know your file list is up-to-date. But that's unnecessary -- just run "tree" inside the perl script (it'll still run just as fast):
(not tested -- I'm not a windows user)my $music_path = ".\\music"; # probably should make this an absolute +path... open my $fh, "D:\\tree /f /a $music_path |" or die "cannot run tree on $music_path: $!"; while ( <$fh> ) { # everything else stays the same... }
Actually, it might also be interesting to see whether a win/dos port of the unix "find" utility is slower or faster than "tree"...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Quick file search
by zentara (Cardinal) on Jan 05, 2006 at 11:46 UTC | |
by graff (Chancellor) on Jan 06, 2006 at 04:48 UTC | |
|
Re^2: Quick file search
by sh1tn (Priest) on Jan 05, 2006 at 05:36 UTC | |
by graff (Chancellor) on Jan 05, 2006 at 05:46 UTC | |
by jplindstrom (Monsignor) on Jan 05, 2006 at 12:26 UTC | |
by sh1tn (Priest) on Jan 06, 2006 at 13:11 UTC |