From 5c02987c5ac955cba5db16e37303b57c8b822c29 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 1 Jan 2026 22:41:47 +0100 Subject: [PATCH] FT8 demod: create logs and save directories if they do not exist. Fixes #2560 --- plugins/channelrx/demodft8/ft8demodworker.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/channelrx/demodft8/ft8demodworker.cpp b/plugins/channelrx/demodft8/ft8demodworker.cpp index 2d63f0ee8..cc062811a 100644 --- a/plugins/channelrx/demodft8/ft8demodworker.cpp +++ b/plugins/channelrx/demodft8/ft8demodworker.cpp @@ -162,6 +162,16 @@ FT8DemodWorker::FT8DemodWorker() : relPath = "ft8/logs"; m_logsPath = dir.absolutePath() + "/" + relPath; qDebug("FT8DemodWorker::FT8DemodWorker: logs path: %s", qPrintable(m_logsPath)); + + QDir samplesDir(m_samplesPath); + if (!samplesDir.exists()) { + samplesDir.mkpath("."); + } + + QDir logsDir(m_logsPath); + if (!logsDir.exists()) { + logsDir.mkpath("."); + } } FT8DemodWorker::~FT8DemodWorker() @@ -270,6 +280,12 @@ void FT8DemodWorker::processBuffer(int16_t *buffer, QDateTime periodTS) logMessage.remove(0, 2); logFile << logMessage.toStdString() << std::endl; } + else + { + if (logFile.is_open()) { + logFile.close(); + } + } if (mapPipes.size() > 0) {