“Update: many people have read this post and suggested that, in the first file example, you should use the much simpler protocol of copying the file to modified to a temp file, modifying the temp file, and then renaming the temp file to overwrite the original file. In fact, that’s probably the most common comment I’ve gotten on this post. If you think this solves the problem, I’m going to ask you to pause for five seconds and consider the problems this might have. (...) The fact that so many people thought that this was a simple solution to the problem demonstrates that this problem is one that people are prone to underestimating,even they’re explicitly warnedthat people tend to underestimate this problem!” -- @danluu, “Files are hard”
aausch comments on Rationality Quotes Thread December 2015