Don't try to access file on local disk in statistics. Refs #400

This commit is contained in:
baldurk
2016-10-19 19:12:41 +02:00
parent d1e5149527
commit 459619ff0c
11 changed files with 44 additions and 16 deletions
+10
View File
@@ -453,6 +453,8 @@ Serialiser::Serialiser(size_t length, const byte *memoryBuf, bool fileheader)
m_Mode = READING;
m_DebugEnabled = false;
m_FileSize = 0;
if(!fileheader)
{
m_BufferSize = length;
@@ -644,6 +646,8 @@ Serialiser::Serialiser(const char *path, Mode mode, bool debugMode)
m_Mode = mode;
m_DebugEnabled = debugMode;
m_FileSize = 0;
FileHeader header;
if(mode == READING)
@@ -658,6 +662,12 @@ Serialiser::Serialiser(const char *path, Mode mode, bool debugMode)
return;
}
FileIO::fseek64(m_ReadFileHandle, 0, SEEK_END);
m_FileSize = FileIO::ftell64(m_ReadFileHandle);
FileIO::fseek64(m_ReadFileHandle, 0, SEEK_SET);
RDCDEBUG("Opened capture file for read");
FileIO::fread(&header, 1, sizeof(FileHeader), m_ReadFileHandle);