dart:io opens files without FILE_SHARE_DELETE, so MoveFileExW with MOVEFILE_REPLACE_EXISTING - and any other replacement strategy - fails while such a reader holds the document open. Fall back to the upstream in-place rewrite so a hostile reader costs at most crash-atomicity for that one write instead of silently dropping it, and sweep the staging copy the rename did not consume.