From b315c131c157106c309608560e1283cb9675694c Mon Sep 17 00:00:00 2001 From: Avinash Kumar Deepak Date: Thu, 19 Feb 2026 16:10:46 +0530 Subject: [PATCH] fix: path slash and retry loop in concoredocker.hpp) --- concoredocker.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/concoredocker.hpp b/concoredocker.hpp index cbce7184..b978f32b 100644 --- a/concoredocker.hpp +++ b/concoredocker.hpp @@ -81,7 +81,7 @@ class Concore { std::vector read(int port, const std::string& name, const std::string& initstr) { std::this_thread::sleep_for(std::chrono::seconds(delay)); - std::string file_path = inpath + std::to_string(port) + "/" + name; + std::string file_path = inpath + "/" + std::to_string(port) + "/" + name; std::ifstream infile(file_path); std::string ins; @@ -94,6 +94,7 @@ class Concore { int attempts = 0, max_retries = 5; while (ins.empty() && attempts < max_retries) { std::this_thread::sleep_for(std::chrono::seconds(delay)); + infile.close(); infile.open(file_path); if (infile) std::getline(infile, ins); attempts++; @@ -110,7 +111,7 @@ class Concore { } void write(int port, const std::string& name, const std::vector& val, int delta = 0) { - std::string file_path = outpath + std::to_string(port) + "/" + name; + std::string file_path = outpath + "/" + std::to_string(port) + "/" + name; std::ofstream outfile(file_path); if (!outfile) { std::cerr << "Error writing to " << file_path << "\n";