mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-15 11:18:29 +12:00
Update title manager when clearing MLC path in settings (#319)
This commit is contained in:
parent
9df1325d14
commit
dd1cb1cccf
4 changed files with 34 additions and 18 deletions
|
@ -280,15 +280,16 @@ uint32_t GetPhysicalCoreCount()
|
|||
|
||||
bool TestWriteAccess(const fs::path& p)
|
||||
{
|
||||
std::error_code ec;
|
||||
// must be path and must exist
|
||||
if (!fs::exists(p) || !fs::is_directory(p))
|
||||
if (!fs::exists(p, ec) || !fs::is_directory(p, ec))
|
||||
return false;
|
||||
|
||||
// retry 3 times
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
const auto filename = p / fmt::format("_{}.tmp", GenerateRandomString(8));
|
||||
if (fs::exists(filename))
|
||||
if (fs::exists(filename, ec))
|
||||
continue;
|
||||
|
||||
std::ofstream file(filename);
|
||||
|
@ -297,7 +298,6 @@ bool TestWriteAccess(const fs::path& p)
|
|||
|
||||
file.close();
|
||||
|
||||
std::error_code ec;
|
||||
fs::remove(filename, ec);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue