From e13613cecc357b0dd01ef85c7c739fd1e0bfebd2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 21 Jul 2012 16:46:29 +0300 Subject: [PATCH] Ensure that the directory exists before trying to write the cache --- source/cache.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/cache.cpp b/source/cache.cpp index 087428f..d4a4ebc 100644 --- a/source/cache.cpp +++ b/source/cache.cpp @@ -1,5 +1,7 @@ #include +#include #include +#include #include #include #include @@ -133,6 +135,9 @@ void Cache::save() const if(data.empty() || !changed) return; + FS::Path dir = FS::dirname(filename); + if(!FS::exists(dir)) + FS::mkpath(dir, 0755); package.get_builder().get_logger().log("files", format("Writing %s", filename)); IO::BufferedFile out(filename.str(), IO::M_WRITE); -- 2.45.2