#include <cstdio>
#include <string>
#include <thread>
-#include <utility>
#include <vector>
#include <cstring>
bool open(const char * ext, const char * function) {
if (is_stdout) {
- if (std::exchange(used_stdout, true)) {
+ if (used_stdout) {
fprintf(stderr, "warning: Not appending multiple file formats to stdout\n");
return false;
}
+
+ used_stdout = true;
#ifdef _WIN32
fout = std::ofstream{"CON"};
#else
// Also assuming /dev is mounted
return true;
}
+
fname_out.resize(basename_length);
fname_out += ext;
fout = std::ofstream{fname_out};