From c62f65585af58dd51e901cb6c2836c4802117760 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Fri, 10 Aug 2012 14:34:55 +0100 Subject: [PATCH] Create local saves dir if it does not exists (fixes #80) --- src/save/LocalSaveActivity.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/save/LocalSaveActivity.cpp b/src/save/LocalSaveActivity.cpp index 0d6a4df30..387d0b868 100644 --- a/src/save/LocalSaveActivity.cpp +++ b/src/save/LocalSaveActivity.cpp @@ -1,3 +1,8 @@ +#ifdef WIN +#include +#else +#include +#endif #include "LocalSaveActivity.h" #include "interface/Label.h" #include "interface/Textbox.h" @@ -105,6 +110,11 @@ void LocalSaveActivity::Save() void LocalSaveActivity::saveWrite(std::string finalFilename) { +#ifdef WIN + _mkdir(LOCAL_SAVE_DIR); +#else + mkdir(LOCAL_SAVE_DIR, 0755); +#endif Client::Ref().WriteFile(save.GetGameSave()->Serialise(), finalFilename); }