From 3a81bb97254b52fc4da086cdcbf9c2ef48f774b4 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Wed, 17 Feb 2021 02:35:00 +0100 Subject: [PATCH] Fixed recorder not creating default recording folder --- recorder/src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recorder/src/main.cpp b/recorder/src/main.cpp index 0eda57d..3c7f44b 100644 --- a/recorder/src/main.cpp +++ b/recorder/src/main.cpp @@ -306,7 +306,13 @@ struct RecorderContext_t { }; MOD_EXPORT void _INIT_() { - + // Create default recording directory + if (!std::filesystem::exists(options::opts.root + "/recordings")) { + spdlog::warn("Recordings directory does not exist, creating it"); + if (!std::filesystem::create_directory(options::opts.root + "/recordings")) { + spdlog::error("Could not create recordings directory"); + } + } } MOD_EXPORT ModuleManager::Instance* _CREATE_INSTANCE_(std::string name) {