From bda7293ea4e6c189eb681fdab85ed7ec5191b344 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Thu, 27 Apr 2023 15:06:18 +0200 Subject: [PATCH] Change permissions only if the file exists --- src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.39.2