From 1cb3bbbef224095e79c59778e784e55a8b1d7f97 Mon Sep 17 00:00:00 2001 From: hypnosis-i2p Date: Sun, 1 Oct 2017 01:34:27 +0800 Subject: [PATCH] does not create gostcoin dir on android if it exists --- src/util.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 1fdaa35..988896b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1095,9 +1095,13 @@ boost::filesystem::path GetDefaultDataDir() { fs::path canonical = fs::canonical(fs::path(std::string (ext))); pathRet = fs::path(std::string(canonical.c_str()) + "/gostcoin"); - qDebug()<<"creating dir" << pathRet.c_str(); boost::filesystem::path dir=pathRet; - boost::filesystem::create_directory(dir); + if (!boost::filesystem::exists(dir)) { + qDebug()<<"creating dir '" << pathRet.c_str() << "'"; + boost::filesystem::create_directory(dir); + }else{ + qDebug()<<"dir exists: '" << pathRet.c_str() << "'"; + } return pathRet; } // otherwise use /data/.../files