Start adding SD card support

This commit is contained in:
wheremyfoodat 2023-08-20 13:22:48 +03:00
parent 3292b051be
commit 7ada8da8a8
6 changed files with 62 additions and 20 deletions

View file

@ -92,11 +92,13 @@ HorizonResult SaveDataArchive::deleteFile(const FSPath& path) {
FileDescriptor SaveDataArchive::openFile(const FSPath& path, const FilePerms& perms) {
if (path.type == PathType::UTF16) {
if (!isPathSafe<PathType::UTF16>(path))
if (!isPathSafe<PathType::UTF16>(path)) {
Helpers::panic("Unsafe path in SaveData::OpenFile");
}
if (perms.raw == 0 || (perms.create() && !perms.write()))
if (perms.raw == 0 || (perms.create() && !perms.write())) {
Helpers::panic("[SaveData] Unsupported flags for OpenFile");
}
fs::path p = IOFile::getAppData() / "SaveData";
p += fs::path(path.utf16_string).make_preferred();