Commit d8b41d9b by iowa\dheitbri

expanded file read error message, now checks to see if either eof or rerror are…

expanded file read error message, now checks to see if either eof or rerror are set and outputs an error message stating what was set.
parent 860c3bc6
......@@ -2,7 +2,7 @@
///
// DAQ low level IO Library
//
// $Id: DaqFileIO.cxx,v 1.14 2007/04/25 17:54:35 dheitbri Exp $
// $Id: DaqFileIO.cxx,v 1.15 2010/05/03 17:25:45 iowa\dheitbri Exp $
// Date: March, 2005
// Author: Yiannis Papelis
//
......@@ -2019,7 +2019,14 @@ CDaqLowLevelIo::ReadFrameHeader(
// Read the frame header; if this fails, we are really in trouble
if ( fread(recHead, sizeof(int), 3, m_pFile) != 3 ) {
sprintf(buf, "Couldn't read file, premature end or messed up file");
if (feof(m_pFile) != 0){
sprintf(buf, "Couldn't read file, premature end of file");
}else if (ferror(m_pFile) != 0){
sprintf(buf, "Couldn't read file, system read error");
}else{
sprintf(buf, "Couldn't read file, uknown issue, EOF not set, read error flag not set");
}
m_LastError = buf;
return eDAQ_READ_ERROR;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment