mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 13:01:27 +12:00
Atomic PARAM.SFO writes
This commit is contained in:
parent
0878db4e17
commit
932f31e37b
9 changed files with 108 additions and 11 deletions
|
@ -602,6 +602,22 @@ namespace fs
|
|||
// Get common cache directory
|
||||
const std::string& get_cache_dir();
|
||||
|
||||
// Unique pending file creation destined to be renamed to the destination file
|
||||
struct pending_file
|
||||
{
|
||||
fs::file file;
|
||||
|
||||
// This is meant to modify files atomically, overwriting is likely
|
||||
bool commit(bool overwrite = true);
|
||||
|
||||
pending_file(const std::string& path);
|
||||
~pending_file();
|
||||
|
||||
private:
|
||||
std::string m_path; // Pending file path
|
||||
std::string m_dest; // Destination file path
|
||||
};
|
||||
|
||||
// Get real path for comparisons (TODO: investigate std::filesystem::path::compare implementation)
|
||||
std::string escape_path(std::string_view path);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue