#include <SMESH_ControlsDef.hxx>
#include <list>
+#include <Standard_ProgramError.hxx>
#include <TCollection_AsciiString.hxx>
+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)
bool Ok;
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();
system( run_nokeep_files.ToCString() ); //clean files
cout<<"GHS3DPRL command : "<<run_GHS3DPRL<<endl;
- OSD_File( GHS3DPRL_Out ).Remove(); //only the master med file
+ removeFile( GHS3DPRL_Out ); //only the master med file
Ok=writeGHS3DPRLFiles(GHS3DPRL_In, meshDS, aSmdsToGHS3DPRLIdMap, aGHS3DPRLIdToNodeMap);
//sometimes it is better to wait flushing files on slow filesystem...