From a1f606352b46308aac084987e5edc283e454bf7a Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Thu, 23 Apr 2020 17:19:36 +0200 Subject: [PATCH] [BL] Refactored IsFileExisting(). --- BaseLib/FileTools.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/BaseLib/FileTools.cpp b/BaseLib/FileTools.cpp index 545dc17436e..6f32612f463 100644 --- a/BaseLib/FileTools.cpp +++ b/BaseLib/FileTools.cpp @@ -14,10 +14,8 @@ #include "FileTools.h" #include "Error.h" -#include "StringTools.h" #include "filesystem.h" -#include <sys/stat.h> #include <boost/algorithm/string.hpp> namespace @@ -36,8 +34,7 @@ namespace BaseLib */ bool IsFileExisting(const std::string &strFilename) { - struct stat buffer {}; - return (stat (strFilename.c_str(), &buffer) == 0); + return fs::exists(fs::path(strFilename)); } double swapEndianness(double const& v) -- GitLab