-
Notifications
You must be signed in to change notification settings - Fork 418
Handle exceptions while writing to files #4400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better I/O handling has been sorely needed for a while. I suspect the .tasproj
corruptions will end with this.
@@ -1,3 +1,5 @@ | |||
#nullable enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check the whole file for null-correctness?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With so much code changes I knew I'd forget something. Checking it now, compiler incorrectly infers string?
for var backupName
yet doesn't complain about passing potentially null to Path.GetFileName
for some reason. There's also a !
null-suppression operator in Directory.CreateDirectory(Path.GetDirectoryName(fn)!);
which would be an issue if the user selected a file in the root directory but that's not one I put there. And there's a ?
that should be added later.
Aside from that, it is of course touching properties of the movie that don't use nullable but it looks like it is handling them correctly.
src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs
Outdated
Show resolved
Hide resolved
fde3481
to
0798074
Compare
Highlights of force push:
|
Well I just re-read the linked issue and realized that this PR does nothing to address that. I had seen BizHawk and autosave and assumed it meant TAStudio auto-saving because I forget that there is another autosave. Handling of sram saving failure will come later. |
…e until writing has completed. Avoids crashing and prevents loss of data in the event of an exception mid-write.
…still broken on close and on TAStudio open.
… sram data length, because it already wasn't true for all cores. Cores that require a specific size should throw if they get the wrong size.
…celing flow even though not all asking and error handling is implemented yet. Also, fix: respect the cancel button.
Now handles errors for SRAM, config file, savestates, and all tools' |
Also make movies write to a temporary file first, writing the entire file before touching the old one.
Addresses #4258.
Check if completed: