mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
fs::write_file aux
This commit is contained in:
parent
0393c7f52c
commit
4bbe1b6bf3
@ -576,4 +576,17 @@ namespace fs
|
||||
result.reset(std::make_unique<container_stream<T>>(std::forward<T>(container)));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
bool write_file(const std::string& path, bs_t<fs::open_mode> mode, const Args&... args)
|
||||
{
|
||||
if (fs::file f{path, mode})
|
||||
{
|
||||
// Write args sequentially
|
||||
int seq[]{ (f.write(args), 0)... };
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ void Emulator::Init()
|
||||
fs::create_dir(dev_hdd0 + "home/00000001/exdata/");
|
||||
fs::create_dir(dev_hdd0 + "home/00000001/savedata/");
|
||||
fs::create_dir(dev_hdd0 + "home/00000001/trophy/");
|
||||
if (fs::file f{dev_hdd0 + "home/00000001/localusername", fs::create + fs::excl + fs::write}) f.write("User"s);
|
||||
fs::write_file(dev_hdd0 + "home/00000001/localusername", fs::create + fs::excl + fs::write, "User"s);
|
||||
fs::create_dir(dev_hdd1 + "cache/");
|
||||
fs::create_dir(dev_hdd1 + "game/");
|
||||
fs::create_path(dev_hdd1);
|
||||
|
Loading…
Reference in New Issue
Block a user