mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
1734cf55d8
On Windows, when the Rename function fails to replace an existing file it will now retry the operation multiple times with increasingly long delays between attempts. This fixes transient rename failures. I've been getting sporadic yet annoyingly frequent errors saying: 'IOS_FS: Failed to rename temporary FST file' These typically appear on startup but I've also gotten them randomly. Investigation shows this happens when the Windows ReplaceFile function returns the error ERROR_UNABLE_TO_REMOVE_REPLACED. That happens in the context of using ReplaceFile to perform an atomic file overwrite, which is required when saving updates to a file to avoid corruption. The error mainly happens with the /Wii/fst.bin file but I've seen it happen with multiple other files as well. I haven't been able to definitively pin down why the error occurs, though online discussions suggest antivirus scanning may be a major culprit. That said, I've excluded the Dolphin folder from Windows Defender scans to no avail and don't have any other antivirus running, so this is likely to be a problem others are experiencing as well. The number and duration of retry delays is arbitrary but I feel like a combined second or so in the worst case is an acceptable tradeoff for the reduction (actually elimination in my experience) of those errors. This is even more true when you consider the time it takes to read and dismiss the error dialogs.