Minor fs::file usage fixes

Do not crash on file creation failure. Make some config writes atomic.
This commit is contained in:
Elad Ashkenazi 2024-06-10 11:49:00 +03:00
parent 4c9296c07f
commit 0b22423ab8
9 changed files with 21 additions and 9 deletions

View file

@ -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);