From 52f13f2339f8c7259d2aa646346b29997b85c0ec Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 9 Dec 2020 05:21:08 -0300 Subject: common/file_util: Succeed on CreateDir when the directory exists --- src/common/file_util.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common') diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index d5f6ea2ee..c4d738bb6 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -98,6 +98,11 @@ bool Delete(const fs::path& path) { bool CreateDir(const fs::path& path) { LOG_TRACE(Common_Filesystem, "directory {}", path.string()); + if (Exists(path)) { + LOG_DEBUG(Common_Filesystem, "path exists {}", path.string()); + return true; + } + std::error_code ec; const bool success = fs::create_directory(path, ec); -- cgit v1.2.3