From 5f2f128f64811da7165a4cb59f090d1f40680a7d Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Fri, 17 Apr 2020 12:01:49 +0200 Subject: [PATCH] Add folder creation to the writer --- core-buffer/src/BinaryWriter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-buffer/src/BinaryWriter.cpp b/core-buffer/src/BinaryWriter.cpp index 92791d4..94cd870 100644 --- a/core-buffer/src/BinaryWriter.cpp +++ b/core-buffer/src/BinaryWriter.cpp @@ -7,6 +7,7 @@ #include #include #include +#include using namespace std; @@ -86,6 +87,8 @@ void BinaryWriter::open_file(const std::string& filename) { close_current_file(); + WriterUtils::create_destination_folder(filename); + output_file_fd_ = ::open(filename.c_str(), O_WRONLY | O_CREAT | O_DSYNC); if (output_file_fd_ < 0) { stringstream err_msg;