I was working on OpenYR’s Save menu when a test caught it replacing a dangling symlink. The old code asked whether the destination existed. That followed the link to a missing target, so the menu treated the name as free. A regular file could also arrive between the check and the write. Either way, the final rename could replace a directory entry without an overwrite confirmation.1
I kept the temporary file and changed how the new save gets its final name. OpenYR writes and syncs the complete snapshot to a sibling file, then calls std::fs::hard_link to give those bytes the requested name. The filesystem rejects that call if the name is already in use, and the menu asks for another name. An existing regular save still goes through confirmation before replacement.2
The check that matters for a new name is the one the filesystem makes when the link is created. I tested two writers starting together and checked that one succeeded, the other got the collision error and the saved bytes matched the winner. The menu test also checks that a collision preserves the current quicksave target. This path requires hard-link support in the save directory.