[PATCH] D27295: Remove existing file in a separate thread asynchronously.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 09:34:02 PST 2016


ruiu added a comment.

As to writing to an existing file as opposed to atomic renaming, I believe the reason why we are doing that is to not leave a corrupted file in case of crash. If you do atomic renaming, you'll get a temporary file in the worst case instead of a broken, partically-written result.

However, that can be resolved by renaming an existing file different temporary name, write to the temporary file, and then rename it back. Maybe we should do that?


https://reviews.llvm.org/D27295





More information about the llvm-commits mailing list