diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index bd55a780fb..f0a7c11474 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -5292,7 +5292,7 @@ static void ppu_initialize2(jit_compiler& jit, const ppu_module& module_part, co if (g_cfg.core.llvm_logs) { out << *_module; // print IR - fs::file(cache_path + obj_name + ".log", fs::rewrite).write(out.str()); + fs::write_file(cache_path + obj_name + ".log", fs::rewrite, out.str()); result.clear(); } diff --git a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp index 4ce1cc27d9..3a3ef1cda3 100644 --- a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp @@ -925,7 +925,7 @@ spu_function_t spu_recompiler::compile(spu_program&& _func) log += "\n\n\n"; // Append log file - fs::file(m_spurt->get_cache_path() + "spu-ir.log", fs::write + fs::append).write(log); + fs::write_file(m_spurt->get_cache_path() + "spu-ir.log", fs::write + fs::append, log); } return fn; diff --git a/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp b/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp index 7dc5baddb5..69e1ace6e4 100644 --- a/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp @@ -1274,7 +1274,7 @@ spu_runtime::spu_runtime() return; } - if (g_cfg.core.spu_debug) + if (g_cfg.core.spu_debug && g_cfg.core.spu_decoder != spu_decoder_type::dynamic && g_cfg.core.spu_decoder != spu_decoder_type::_static) { if (!fs::create_dir(m_cache_path + "llvm/")) { diff --git a/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp index 20b0bb9740..5020fd8924 100644 --- a/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp @@ -2635,7 +2635,7 @@ public: if (g_cfg.core.spu_debug) { - fs::file(m_spurt->get_cache_path() + "spu-ir.log", fs::write + fs::append).write(log); + fs::write_file(m_spurt->get_cache_path() + "spu-ir.log", fs::write + fs::append, log); } if (auto& cache = g_fxo->get()) diff --git a/rpcs3/Emu/Io/mouse_config.cpp b/rpcs3/Emu/Io/mouse_config.cpp index 18fe03701c..4538d92caa 100644 --- a/rpcs3/Emu/Io/mouse_config.cpp +++ b/rpcs3/Emu/Io/mouse_config.cpp @@ -29,7 +29,13 @@ bool mouse_config::load() void mouse_config::save() const { - fs::file(cfg_name, fs::rewrite).write(to_string()); + fs::pending_file file(cfg_name); + + if (file.file) + { + file.file.write(to_string()); + file.commit(); + } } cfg::string& mouse_config::get_button(int code) diff --git a/rpcs3/Emu/RSX/GL/glutils/program.cpp b/rpcs3/Emu/RSX/GL/glutils/program.cpp index 080a932530..eaeb6f2540 100644 --- a/rpcs3/Emu/RSX/GL/glutils/program.cpp +++ b/rpcs3/Emu/RSX/GL/glutils/program.cpp @@ -130,7 +130,7 @@ namespace gl break; } - fs::file(fs::get_cache_dir() + base_name + std::to_string(m_id) + ".glsl", fs::rewrite).write(str, length); + fs::write_file(fs::get_cache_dir() + base_name + std::to_string(m_id) + ".glsl", fs::rewrite, str, length); } glShaderSource(m_id, 1, &str, &length); diff --git a/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp index e0a0658d74..c34e77c0d6 100644 --- a/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp @@ -426,7 +426,7 @@ void VKFragmentProgram::Decompile(const RSXFragmentProgram& prog) void VKFragmentProgram::Compile() { if (g_cfg.video.log_programs) - fs::file(fs::get_cache_dir() + "shaderlog/FragmentProgram" + std::to_string(id) + ".spirv", fs::rewrite).write(shader.get_source()); + fs::write_file(fs::get_cache_dir() + "shaderlog/FragmentProgram" + std::to_string(id) + ".spirv", fs::rewrite, shader.get_source()); handle = shader.compile(); } diff --git a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp index 390ca0bb39..fae195b1dc 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp @@ -361,7 +361,7 @@ void VKVertexProgram::Decompile(const RSXVertexProgram& prog) void VKVertexProgram::Compile() { if (g_cfg.video.log_programs) - fs::file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".spirv", fs::rewrite).write(shader.get_source()); + fs::write_file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".spirv", fs::rewrite, shader.get_source()); handle = shader.compile(); } diff --git a/rpcs3/Input/evdev_joystick_handler.h b/rpcs3/Input/evdev_joystick_handler.h index ef3832d431..82c5463289 100644 --- a/rpcs3/Input/evdev_joystick_handler.h +++ b/rpcs3/Input/evdev_joystick_handler.h @@ -70,7 +70,13 @@ struct positive_axis : cfg::node void save() { - fs::file(cfg_name, fs::rewrite).write(to_string()); + fs::pending_file file(cfg_name); + + if (file.file) + { + file.file.write(to_string()); + file.commit(); + } } bool exist()