diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-11-10 18:23:53 +0300 |
---|---|---|
committer | Vlad Mihaylenko <vxmihaylenko@gmail.com> | 2017-11-13 10:39:46 +0300 |
commit | 74bb9316ef751d3312ee7085b4648356bf6b2fac (patch) | |
tree | 716eb05f1e5435a0e8dac489576cb5b7074fb254 | |
parent | 27802b5395d8bbc1d423569ab763d6cb594b92fb (diff) |
[ugc] fix pathsbeta-1108
-rw-r--r-- | ugc/storage.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ugc/storage.cpp b/ugc/storage.cpp index 756678be54..02f35eabd5 100644 --- a/ugc/storage.cpp +++ b/ugc/storage.cpp @@ -32,13 +32,23 @@ string const kTmpFileExtension = ".tmp"; using Sink = MemWriter<string>; -string GetUGCFilePath() { return my::JoinPath(GetPlatform().WritableDir(), kUGCUpdateFileName); } +string GetUGCFilePath() { return my::JoinPath(GetPlatform().SettingsDir(), kUGCUpdateFileName); } -string GetIndexFilePath() { return my::JoinPath(GetPlatform().WritableDir(), kIndexFileName); } +string GetIndexFilePath() { return my::JoinPath(GetPlatform().SettingsDir(), kIndexFileName); } bool GetUGCFileSize(uint64_t & size) { - return GetPlatform().GetFileSizeByName(kUGCUpdateFileName, size); + try + { + FileReader reader(GetUGCFilePath(), true /* with exceptions */); + size = reader.Size(); + } + catch (RootException const &) + { + return false; + } + + return true; } void DeserializeUGCIndex(string const & jsonData, vector<Storage::UGCIndex> & res) |