Listing 3: Check for regular files
306 if ( -f $rfile ) # regular file
307 {
308 $cmd = "cp $rfile $lfile";
309 system $cmd;
310 if ($?>>8)
311 {
312 print STDERR "error executing system command :\n";
313 print STDERR "\t\"$cmd\n";
314 $msg .= "\tERROR copying $rfile to $lfile\n";
315 }
316 else
317 {
318 chown($r_uid,$lfile);
319 chmod($r_mode,$lfile);
320 utime($r_atime,$r_mtime,$lfile);
321 $msg .= "\tcopied $rfile to $lfile\n";
322 }
323 }
|