Add SystemSaveData::CreateFile

This commit is contained in:
wheremyfoodat 2023-09-13 23:29:49 +03:00
parent 7c2167e0f2
commit 1332488326
3 changed files with 39 additions and 6 deletions

View file

@ -12,8 +12,9 @@ HorizonResult SaveDataArchive::createFile(const FSPath& path, u64 size) {
fs::path p = IOFile::getAppData() / "SaveData";
p += fs::path(path.utf16_string).make_preferred();
if (fs::exists(p))
if (fs::exists(p)) {
return Result::FS::AlreadyExists;
}
IOFile file(p.string().c_str(), "wb");
@ -33,7 +34,7 @@ HorizonResult SaveDataArchive::createFile(const FSPath& path, u64 size) {
return Result::FS::FileTooLarge;
}
Helpers::panic("SaveDataArchive::OpenFile: Failed");
Helpers::panic("SaveDataArchive::CreateFile: Failed");
return Result::Success;
}