From 729611cc1622d4a0e66daa21bf78da3ffb1719a8 Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Fri, 2 Feb 2018 19:22:09 +0000 Subject: [PATCH] Issue with trailing slashes in creating directories. --- lib/local/Utilities/src/RecorderOpenFace.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/local/Utilities/src/RecorderOpenFace.cpp b/lib/local/Utilities/src/RecorderOpenFace.cpp index 5908a96..62ca86d 100644 --- a/lib/local/Utilities/src/RecorderOpenFace.cpp +++ b/lib/local/Utilities/src/RecorderOpenFace.cpp @@ -59,6 +59,9 @@ void CreateDirectory(std::string output_path) // Creating the right directory structure auto p = path(output_path); + // Deal with a case where directory ends with a / or \\ + p.remove_trailing_separator(); + if (!boost::filesystem::exists(p)) { bool success = boost::filesystem::create_directories(p);