Introduce update logic to copy_file_non_atomic