From dd497e5a02c81ac421b3319abbb8b52d7f487aed Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 2 Nov 2014 13:30:00 -0800 Subject: [PATCH] Show an error when savedata can't be written. Normally we'll log when the disk is full for files, but if we can't even create the folder, we'll get errors trying to write into a non-existing directory. --- Common/FileUtil.cpp | 2 +- Core/Dialog/SavedataParam.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Common/FileUtil.cpp b/Common/FileUtil.cpp index 27d04231e0..069d1e33c3 100644 --- a/Common/FileUtil.cpp +++ b/Common/FileUtil.cpp @@ -306,7 +306,7 @@ bool CreateFullPath(const std::string &fullPath) if (position == fullPath.npos) { if (!File::Exists(fullPath)) - File::CreateDir(fullPath); + return File::CreateDir(fullPath); return true; } std::string subPath = fullPath.substr(0, position); diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 648c73d988..272ffb4e42 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -369,8 +369,12 @@ bool SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &save std::string dirPath = GetSaveFilePath(param, GetSaveDir(param, saveDirName)); - if (!pspFileSystem.GetFileInfo(dirPath).exists) - pspFileSystem.MkDir(dirPath); + if (!pspFileSystem.GetFileInfo(dirPath).exists) { + if (!pspFileSystem.MkDir(dirPath)) { + I18NCategory *err = GetI18NCategory("Error"); + osm.Show(err->T("Unable to write savedata, disk may be full")); + } + } u8* cryptedData = 0; int cryptedSize = 0;