fs: alternative fs::pending_file implementation (Win32)

Use MOVEFILE_WRITE_THROUGH instead of sync() on commit().
This commit is contained in:
Nekotekina 2021-06-20 14:45:33 +03:00
parent aaa20c0ff0
commit 3c614d95b8
3 changed files with 21 additions and 1 deletions

View file

@ -1946,7 +1946,9 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
if (auto file = pair.second.release())
{
auto&& fvec = static_cast<fs::container_stream<std::vector<uchar>>&>(*file);
ensure(fs::write_file<true>(new_path + vfs::escape(pair.first), fs::rewrite, fvec.obj));
fs::pending_file f(new_path + vfs::escape(pair.first));
f.file.write(fvec.obj);
ensure(f.commit());
}
}