mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-01 03:32:07 +00:00
Atomically overwrite games.yml
Reduce chances of losing information.
This commit is contained in:
parent
3d7c38ff9d
commit
bfee541540
@ -1202,7 +1202,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
|
|||||||
games[m_title_id] = bdvd_dir;
|
games[m_title_id] = bdvd_dir;
|
||||||
YAML::Emitter out;
|
YAML::Emitter out;
|
||||||
out << games;
|
out << games;
|
||||||
fs::file(fs::get_config_dir() + "/games.yml", fs::rewrite).write(out.c_str(), out.size());
|
fs::file(fs::get_config_dir() + "/_tmp_games.yml", fs::rewrite).write(out.c_str(), out.size());
|
||||||
|
fs::rename(fs::get_config_dir() + "/_tmp_games.yml", fs::get_config_dir() + "/games.yml", true);
|
||||||
}
|
}
|
||||||
else if (m_cat == "1P" && from_hdd0_game)
|
else if (m_cat == "1P" && from_hdd0_game)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user