Ok I debugged the problem using Process Monitor to look at the system calls. It appears my system is too fast executing eschalon or too slow todelete a file, however you want to look at it. It looks like a race condition of some sort.
Here's what's going down:
When writing to a save slot (let's use slot 1 as example) Eschalon does the following:
- Go through all files in Slot 1 and delete them 1 by one
- Check if Slot 1 is really gone
- Write new save data to tmp
- Copy all files from tmp to slot1
The problem is at the check step. When it works, it looks like this:
In Line 4, it deletes the slot1 dir.
In Line 7, it is confirmed to be gone ("NO SUCH FILE","Filter: slot1")
Notice the NO SUCH FILE at the end. That is Eschalon getting confirmation from the System that slot1 is really gone.
Now this is what happens when the error occurs:
In Line 4, the Delete Command is issued with the success result.
In Line 7, it queries for directory - and finds it! ("SUCCESS","Filter: slot1, 1: slot1")
And that is what confuses the savegame code.
After that Eschalon tries to use slot1 dir, but it's gone, because it got delay deleted just after looking for it. I can only image this whole thing happens from multiple threads and these threads are not synchronized properly.
That is enough debugging from my end. I hope this is enough information for the dev to fix it for good this time.