in reply to Search and update scripts
The big performance killer is searching your entire set of drives twice.
Search through the drives once and pop the names on to 2 arrays. Then go and perform your modifications.
Also index is quicker than a regex.
Quick hack and untested:
my @rename_files; my @modify_files; finddepth (\&get_filenames , @fixedDrives ); sub get_filenames { push(@rename_files,$File::Find::name) if( index($File::Find::name,$old_hostname) + 1 ); #index should + be quicker push(@modfy_files,$File::Find::name) if ( -T $File::Find::name ); # -T is the same as -f and ! -B }
| Mynd you, mønk bites Kan be pretti nasti... |
|
|---|