From d4447a1ffaa242a49535c9bbca79c61d10927640 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sat, 30 Jul 2022 12:53:08 -0500 Subject: [PATCH] Small patch to fix creating directory if it doesn't already exist --- src/cache.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cache.cpp b/src/cache.cpp index 9ba955f..35bc659 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -15,9 +15,10 @@ namespace gdpm::cache{ char *errmsg; /* Check and make sure directory is created before attempting to open */ - if(!std::filesystem::exists(cache_path)){ + using namespace fs = std::filesystem; + if(!fs::exists(fs::path(cache_path).parent_path())){ log::info("Creating cache directories...{}", cache_path); - std::filesystem::create_directories(cache_path); + fs::create_directories(cache_path); } int rc = sqlite3_open(cache_path.c_str(), &db);