Hi,
I am recursively searching my pc for a some files and renaming them. I can't get my script to avoid searching in a particular folder and its subdirectory. The folder in particular is 'c:\\WINNT'.
Here a snippet:
finddepth (\&rename_file_dir , "c:\\" );
sub rename_file_dir
{
if( /(.*)csscs_ref(.*)/i )# any files or directories
{
$orig = $File::Find::name ;
$concat = $File::Find::dir . "\/$1$new_hostname$2";
rename($orig, $concat) || print "error can't rename $orig to $concat: $!"
}
}
How can I rewrite the subroutine so that the script looks for all file that has the substring "csscs_ref" but not in the 'c:\\WINNT' folder.
--thanks
I am recursively searching my pc for a some files and renaming them. I can't get my script to avoid searching in a particular folder and its subdirectory. The folder in particular is 'c:\\WINNT'.
Here a snippet:
finddepth (\&rename_file_dir , "c:\\" );
sub rename_file_dir
{
if( /(.*)csscs_ref(.*)/i )# any files or directories
{
$orig = $File::Find::name ;
$concat = $File::Find::dir . "\/$1$new_hostname$2";
rename($orig, $concat) || print "error can't rename $orig to $concat: $!"
}
}
How can I rewrite the subroutine so that the script looks for all file that has the substring "csscs_ref" but not in the 'c:\\WINNT' folder.
--thanks