From eef4712b6ea6e16d79586d83cb8c39e798f495af Mon Sep 17 00:00:00 2001 From: Sude <lgogdownloader@gmail.com> Date: Thu, 16 Oct 2014 11:31:08 +0300 Subject: [PATCH] Make sure that cache directory exists --- main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.cpp b/main.cpp index a3558f9..413260a 100644 --- a/main.cpp +++ b/main.cpp @@ -208,6 +208,16 @@ int main(int argc, char *argv[]) } } + path = config.sCacheDirectory; + if (!boost::filesystem::exists(path)) + { + if (!boost::filesystem::create_directories(path)) + { + std::cout << "Failed to create directory: " << path << std::endl; + return 1; + } + } + if (boost::filesystem::exists(config.sConfigFilePath)) { std::ifstream ifs(config.sConfigFilePath.c_str());