diff --git a/LoadCSVData.pl b/LoadCSVData.pl index 9d6b76f..5cddb49 100755 --- a/LoadCSVData.pl +++ b/LoadCSVData.pl @@ -53,6 +53,8 @@ my $G201_fcheck = 0; my $D2W_fcheck = 0; my $FtpToCustomerCmd = 'SendFtpElabData.pl'; my ( $scriptname, $scriptpath ); +my $MatlabErrorFilename = "/tmp/"; +my $matlabOutputError = ''; sub getTimeStamp { # parm [ts] => timestamp for filename; log => timestamp for log @@ -116,6 +118,7 @@ sub matlabCalc { . " - pid $$ >> $unit - $tool MatLab calc started...\n"; if ( $matlab_cmd =~ /_lnx$/ ) { $matlab_cmd = './run_' . $matlab_cmd . '.sh'; + $MatlabErrorFilename .= "${unit}${tool}_output_error.txt"; #print $ENV{"HOME"} . "\n"; $ENV{"HOME"} = "/" . $ENV{"HOME"}; @@ -126,6 +129,14 @@ sub matlabCalc { my @args = ( 'timeout', $matlab_timeout, $matlab_cmd, $matlab_rt, $unit, $tool ); if ( system(@args) != 0 ) { + open( my $fh, '<', $MatlabErrorFilename ) + or warn print getTimeStamp("log") + . " - pid $$ >> Cannot open Matlab output error file: ${MatlabErrorFilename}\n"; + { + local $/; + $matlabOutputError = <$fh>; + } + close($fh); my $exit_value = $? >> 8; if ( $exit_value == 124 ) { print getTimeStamp("log") @@ -310,6 +321,7 @@ sub makeEmailMsg {