Salome HOME
Issue 0016760: Fix pb in zero size of MED file
authorvsr <vsr@opencascade.com>
Mon, 9 Jun 2008 07:08:28 +0000 (07:08 +0000)
committervsr <vsr@opencascade.com>
Mon, 9 Jun 2008 07:08:28 +0000 (07:08 +0000)
src/SMESH_I/SMESH_Mesh_i.cxx

index a58c5ad0ecca3e6f7e28eb59132232908157f596..a5d5ae2ec4b4baf2348c7cf9531947bed978c577 100644 (file)
@@ -72,6 +72,7 @@
 #include <string>
 #include <iostream>
 #include <sstream>
+#include <sys/stat.h>
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -266,6 +267,14 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName )
   myFileInfo           = new SALOME_MED::MedFileInfo();
   myFileInfo->fileName = theFileName;
   myFileInfo->fileSize = 0;
+#ifdef WIN32
+  struct _stati64 d;
+  if ( ::_stati64( theFileName, &d ) != -1 )
+#else
+  struct stat64 d;
+  if ( ::stat64( theFileName, &d ) != -1 )
+#endif
+    myFileInfo->fileSize = d.st_size;
   myFileInfo->major    = major;
   myFileInfo->minor    = minor;
   myFileInfo->release  = release;