From: eap Date: Wed, 9 Oct 2019 14:02:22 +0000 (+0300) Subject: Avoid chmod() on non-existing output file X-Git-Tag: V9_4_0b1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9e01259dd990803013075945870fcc9bf3b785d2;p=plugins%2Fhexoticplugin.git Avoid chmod() on non-existing output file --- diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx index ecc0adc..e38fe7e 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx @@ -1110,7 +1110,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, // read a result // -------------- - if ( mgHexa.IsExecutable() ) + if ( mgHexa.IsExecutable() && SMESH_File( Hexotic_Out.ToCString() ).exists() ) { #ifndef WIN32 modeFile_Out += Hexotic_Out; @@ -1193,13 +1193,13 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel { _computeCanceled = false; /* - SMESH_ComputeErrorPtr myError = SMESH_ComputeError::New(); -*/ + SMESH_ComputeErrorPtr myError = SMESH_ComputeError::New(); + */ bool Ok = true; TCollection_AsciiString hexahedraMessage; TCollection_AsciiString aQuote(""); #ifdef WIN32 - aQuote = "\""; + aQuote = "\""; #endif SetParameters(_hypothesis); @@ -1214,7 +1214,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel Hexotic_In = aTmpDir + "Hexotic"+getSuffix()+"_In.mesh"; Hexotic_Out = aTmpDir + "Hexotic"+getSuffix()+"_Out.mesh"; Hexotic_SizeMap_Prefix = aTmpDir + "Hexotic_SizeMap"; - + MG_Hexotic_API mgHexa( _computeCanceled, _progress ); std::vector sizeMapFiles = writeSizeMapFile( &mgHexa, Hexotic_SizeMap_Prefix.ToCString() ); @@ -1253,7 +1253,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel // read a result // -------------- - if ( mgHexa.IsExecutable() ) + if ( mgHexa.IsExecutable() && SMESH_File( Hexotic_Out.ToCString() ).exists() ) { modeFile_Out += Hexotic_Out; system( modeFile_Out.ToCString() );