From 309b24af04c67baa12a03a229632fa1a43207305 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 16 Jun 2020 04:39:15 -0500 Subject: [PATCH] [ox/fs] Make PassthroughFS mkdir pass mkdir -p on existing directory (synced from f58c658be1471c18ee958f31725a00d51a360a6b) --- src/ox/fs/filesystem/passthroughfs.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ox/fs/filesystem/passthroughfs.cpp b/src/ox/fs/filesystem/passthroughfs.cpp index 17d0fc238..0263a9383 100644 --- a/src/ox/fs/filesystem/passthroughfs.cpp +++ b/src/ox/fs/filesystem/passthroughfs.cpp @@ -7,6 +7,7 @@ */ #include "passthroughfs.hpp" +#include #if defined(OX_HAS_PASSTHROUGHFS) @@ -31,7 +32,11 @@ Error PassThroughFS::mkdir(const char *path, bool recursive) { const auto u8p = p.u8string(); oxTrace("ox::fs::PassThroughFS::mkdir") << u8p.c_str(); if (recursive) { - success = std::filesystem::create_directories(p); + if (std::filesystem::is_directory(p)) { + success = true; + } else { + success = std::filesystem::create_directories(p); + } } else { success = std::filesystem::create_directory(p); }