From 9f95d33e594088d9e95a3d77818de3cc6e4b7dba Mon Sep 17 00:00:00 2001 From: ChenguangMa Date: Mon, 5 Jul 2021 10:56:53 +0800 Subject: [PATCH] when create_intermediate_dirs == true, NPT_File::CreateDir(const char* path, bool create_intermediate_dirs) dosen't work correctly on window 10. fix it. --- Source/Core/NptFile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/NptFile.cpp b/Source/Core/NptFile.cpp index e88e1800..ef325e89 100644 --- a/Source/Core/NptFile.cpp +++ b/Source/Core/NptFile.cpp @@ -147,7 +147,9 @@ NPT_File::CreateDir(const char* path, bool create_intermediate_dirs) dir_path = full_path.SubString(0, separator); // create the directory non recursively - NPT_CHECK_WARNING(NPT_File::CreateDir(dir_path, false)); + if (!NPT_File::Exists(dir_path)) { + NPT_CHECK_WARNING(NPT_File::CreateDir(dir_path, false)); + } // look for the next delimiter separator = full_path.Find(NPT_FilePath::Separator, separator + 1);