[Kernel] Added support for writing/reading GPD files

This breaks settings in games that are using them and savefiles in games that use settings to store progress
This commit is contained in:
Gliniak
2024-12-15 13:58:08 +01:00
committed by Radosław Gliński
parent ccf7adf015
commit 1110cdd372
58 changed files with 4642 additions and 2122 deletions

View File

@@ -104,10 +104,20 @@ bool HostPathEntry::DeleteEntryInternal(Entry* entry) {
auto removed = std::filesystem::remove_all(full_path, ec);
return removed >= 1 && removed != static_cast<std::uintmax_t>(-1);
} else {
// Delete file only if it exists.
return !std::filesystem::is_directory(full_path) &&
(!std::filesystem::exists(full_path) ||
std::filesystem::remove(full_path, ec));
// Skip directories, they we're handled above.
if (std::filesystem::is_directory(full_path)) {
return false;
}
if (std::filesystem::exists(full_path)) {
const auto result = std::filesystem::remove(full_path, ec);
if (ec) {
XELOGE("{}: Cannot remove file entry. File: {} Error: {}", __func__,
full_path, ec.message());
return false;
}
}
return true;
}
}