print "After create SubDir routine.";
createSubDirs($fileDir);
my $from = $ORACLE_HOME.$dirSep.$file;
my $to = $bootstrapDir.$dirSep.$fileDir;
if ($isWindows) {
copy($from, $to);
} else {
system("cp -rf $from $to");
}
print "\nCopied file $from to $to\n";
In the above code I wanted to handle the case that during copy when: No space left on device it should not keep listing error for every file to the user that: " No space left on device" either it should just gracefully come out saying the "Process Failed."
then I manipulated the code like:
else {
system("cp -rf $from $to 2>/dev/null");
if ($? ne 0){
print "Process failed."
}
but it seems the return code is still returning code as 0 and I still could not trap the error.
Please suggest.
The code I mentioned is the perl code .. I just missed to mention that.