From 6a9160fcc108c1987a6edfd5ab2d40f3c5749dae Mon Sep 17 00:00:00 2001 From: codereader Date: Thu, 22 Apr 2021 19:40:59 +0200 Subject: [PATCH] Create parent directories too in os::makeDirectory, to fix errors when trying to create the logfile with a non-existent .cache directory --- libs/os/dir.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/os/dir.h b/libs/os/dir.h index 1358ac5cbe..add632fa16 100644 --- a/libs/os/dir.h +++ b/libs/os/dir.h @@ -55,8 +55,8 @@ inline bool makeDirectory(const std::string& name) { fs::path dirPath(name); - // Create the directory - if (fs::create_directory(dirPath)) + // Create the directory, including nonexistent parents + if (fs::create_directories(dirPath)) { // Directory has been created, set permissions rMessage() << "Directory " << dirPath << " created successfully." << std::endl;