File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 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
360367bool 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
373391void create_output_directory (const std::string& path)
374392{
You can’t perform that action at this time.
0 commit comments