Salome HOME
IMP 22792: EDF 8159 SMESH: Multi-dimensional extrusion/extrusion along a path/revolution
[modules/smesh.git] / src / MEDWrapper / V2_2 / MED_V2_2_Wrapper.cxx
index 09361d0eaa2fc16dc0585eeff7b2b300dd098238..b12af78505f9ddac29a298e92982dbd30a058b24 100644 (file)
@@ -163,11 +163,26 @@ namespace MED
 
 
     //---------------------------------------------------------------
-    TVWrapper::TVWrapper(const std::string& theFileName): 
+    TVWrapper::TVWrapper(const std::string& theFileName):
       myFile(new TFile(theFileName))
-    {}
-    
-    
+    {
+      TErr aRet;
+      myFile->Open( eLECTURE_ECRITURE, &aRet );
+      // if(aRet < 0)
+      //   myFile->Close();
+      //   myFile->Open( eLECTURE_AJOUT, &aRet );
+      // }
+      if(aRet < 0) {
+        myFile->Close();
+        myFile->Open( eLECTURE, &aRet );
+      }
+      if(aRet < 0) {
+        myFile->Close();
+        myFile->Open( eCREATION, &aRet );
+      }
+    }
+
+
     //----------------------------------------------------------------------------
     TInt
     TVWrapper
@@ -2871,5 +2886,5 @@ namespace MED
         EXCEPTION(std::runtime_error,"GetGrilleInfo - MEDmeshGridStructRd(...)");
     }
 
-  }  
+  }
 }