Skip to content

Commit 8a10d7f

Browse files
committed
test
1 parent b8d1cbb commit 8a10d7f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

modules/PhysiCell_settings.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@
6565
###############################################################################
6666
*/
6767

68+
#include <version>
69+
70+
#ifdef __cpp_lib_filesystem
6871
#include <filesystem>
72+
#else
73+
#include <sys/stat.h>
74+
#endif
6975

7076
#include "./PhysiCell_settings.h"
7177
#include "../core/PhysiCell_cell.h"
@@ -357,6 +363,7 @@ bool create_directories(const std::string &path)
357363
return create_directory(path);
358364
}
359365

366+
#ifdef __cpp_lib_filesystem
360367
bool create_directory(const std::string &path)
361368
{
362369
if (std::filesystem::exists(path)) {
@@ -369,6 +376,17 @@ bool create_directory(const std::string &path)
369376
return false; // An error occurred
370377
}
371378
}
379+
#else
380+
bool create_directory(const std::string &path)
381+
{
382+
#if defined(__MINGW32__) || defined(__MINGW64__)
383+
bool success = mkdir(path.c_str()) == 0;
384+
#else
385+
bool success = mkdir(path.c_str(), 0755) == 0;
386+
#endif
387+
return success || errno == EEXIST;
388+
}
389+
#endif
372390

373391
void create_output_directory(const std::string& path)
374392
{

0 commit comments

Comments
 (0)