-
I'm trying to utilise caching and prebuilt routines to give away static resources. But actually I need to update them, I suppose it's actually race free due to OS synchronisation of file I/O, but just to be sure. Is it alright? |
Beta Was this translation helpful? Give feedback.
Answered by
an-tao
May 30, 2024
Replies: 1 comment 2 replies
-
You could create a temporary file for the new content and rename it to the target file name after writing. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
std::filesystem::rename is an atomic operation on files, so you can use it to recursively rename new files.