Clear temp folder on boot

My tests rely on this, and some games do too.
Two birds with one stone
This commit is contained in:
Stephen Miller 2025-04-28 12:37:36 -05:00
parent 384e036533
commit ad089f014e

View File

@ -227,6 +227,10 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
const auto& mount_temp_dir = Common::FS::GetUserPath(Common::FS::PathType::TempDataDir) / id;
if (!std::filesystem::exists(mount_temp_dir)) {
std::filesystem::create_directory(mount_temp_dir);
} else {
// Temportary directory should be cleared on each boot.
std::filesystem::remove_all(mount_temp_dir);
std::filesystem::create_directory(mount_temp_dir);
}
mnt->Mount(mount_temp_dir, "/temp0"); // called in app_content ==> stat/mkdir
mnt->Mount(mount_temp_dir, "/temp");