We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d029e9 commit 97749e8Copy full SHA for 97749e8
src/parameter_tracer.cpp
@@ -1,4 +1,5 @@
1
#include <sys/stat.h>
2
+#include <string>
3
#include <cstdlib>
4
#include <sstream>
5
#include "parameter_tracer.h"
@@ -7,7 +8,13 @@ using namespace arma;
7
8
ParameterTracer::ParameterTracer(bool trace, bool trace_latent, const std::string& trace_directory)
9
: trace { trace }, trace_latent { trace_latent }, trace_directory { trace_directory } {
10
if(trace) {
11
+#ifdef _WIN32
12
+ // On Windows, mkdir takes only one argument
13
+ int status = mkdir(trace_directory.c_str());
14
+#else
15
+ // On POSIX systems, mkdir takes two arguments
16
int status = mkdir(trace_directory.c_str(), 0777);
17
+#endif
18
if (status != 0) {
19
Rcpp::stop("Error creating trace directory.");
20
}
0 commit comments