From 36778432b81ea34799d4d46d7ebd818e270ecf70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Noel?= Date: Mon, 17 Feb 2025 08:58:48 +0100 Subject: [PATCH] implement MakeSureDirectoryPathExists() --- Sources/Engine/Base/Stream.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/Engine/Base/Stream.cpp b/Sources/Engine/Base/Stream.cpp index 79cc5d6..587476a 100755 --- a/Sources/Engine/Base/Stream.cpp +++ b/Sources/Engine/Base/Stream.cpp @@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include +#include // !!! FIXME : rcg10162001 Need this anymore, since _findfirst() is abstracted? #ifdef PLATFORM_WIN32 @@ -918,7 +919,13 @@ void CTFileStream::Open_t(const CTFileName &fnFileName, CTStream::OpenMode om/*= static void MakeSureDirectoryPathExists(const CTFileName &fnmFullFileName) { - STUBBED("!!! FIXME: get the code back in from Ryan's original port."); + CTFileName fnDirectory = fnmFullFileName.FileDir(); + const char *path = (const char *) (CTString&)fnDirectory; + std::error_code ec; + std::filesystem::create_directories(path, ec); + if (ec) { + FatalError("Cannot create directory path:\n%s", path); + } } /*