Salome HOME
MEDCoupling Memory output from SMESH engine now deal with fields too.
[modules/smesh.git] / src / MEDWrapper / MED_Wrapper.cxx
index 4d0f992714aa6140a2198f0178c0de2d824a0363..ad18d170c40a6d67674b5eff553d808de7529215 100644 (file)
@@ -90,10 +90,10 @@ namespace MED
     if (this->myCount++ == 0)
     {
       std::string dftFileName = MEDCoupling::MEDFileWritableStandAlone::GenerateUniqueDftFileNameInMem();
-      memfile = MED_MEMFILE_INIT;
-      memfile.app_image_ptr=0;
-      memfile.app_image_size=0;
-      myFid = MEDmemFileOpen(dftFileName.c_str(),&memfile,MED_FALSE,MED_ACC_CREAT);
+      med_access_mode modeTmp(MED_ACC_CREAT);
+      if(memfile.app_image_ptr)
+        modeTmp = med_access_mode(theMode);
+      myFid = MEDmemFileOpen(dftFileName.c_str(),&memfile,MED_FALSE,modeTmp);
     }
     if (theErr)
       *theErr = TErr(myFid);