From: Christophe Bourcier Date: Thu, 27 Apr 2023 13:06:18 +0000 (+0200) Subject: Change permissions only if the file exists X-Git-Tag: V9_11_0a2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7f158a1b8f1d3da1837437f4ebd185c533eb27a3;p=plugins%2Fghs3dplugin.git Change permissions only if the file exists --- diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 6e0012c..fbc5bf1 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -119,7 +119,8 @@ static std::string flagsToErrorStr( int anInvalidEnforcedFlags ) // change results files permissions to user only (using boost to be used without C++17) static void chmodUserOnly(const char* filename) { - boofs::permissions(filename, boofs::remove_perms | boofs::group_all | boofs::others_all ); + if (boofs::exists(filename)) + boofs::permissions(filename, boofs::remove_perms | boofs::group_all | boofs::others_all ); } typedef const list TTriaList;