#include <SMESH_ControlsDef.hxx>
#include <list>
+#include <Standard_ProgramError.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopoDS.hxx>
}
using namespace med_2_2;*/
+static void removeFile( const TCollection_AsciiString& fileName )
+{
+ try {
+ OSD_File( fileName ).Remove();
+ }
+ catch ( Standard_ProgramError ) {
+ MESSAGE("Can't remove file: " << fileName.ToCString() << " ; file does not exist or permission denied");
+ }
+}
+
//=============================================================================
GHS3DPRLPlugin_GHS3DPRL::GHS3DPRLPlugin_GHS3DPRL(int hypId, int studyId, SMESH_Gen* gen)
: SMESH_3D_Algo(hypId, studyId, gen)
int ifam=0;
TCollection_AsciiString namefile(GHS3DPRL_In);
namefile+=".points";
- OSD_File(namefile).Remove();
+ removeFile(namefile);
ofstream theFile;
theFile.open(namefile.ToCString(),ios::out);
#ifdef WIN32
theFile.close();
namefile=GHS3DPRL_In+".faces";
- OSD_File(namefile).Remove();
+ removeFile(namefile);
theFile.open(namefile.ToCString(),ios::out);
#ifdef WIN32
Ok=theFile->is_open();
cout<<"GHS3DPRL command : "<<run_GHS3DPRL.ToCString()<<endl;
cout<<"Write files .faces .point ...";
GHS3DPRL_Out = path + casenamemed;
- OSD_File( GHS3DPRL_Outxml ).Remove(); //only the master xml file
+ removeFile( GHS3DPRL_Outxml ); //only the master xml file
Ok=writeGHS3DPRLFiles(GHS3DPRL_In, meshDS, aSmdsToGHS3DPRLIdMap, aGHS3DPRLIdToNodeMap);
if (Ok) {cout<<" ...done\n";}
else {