You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are situations where a program might crash while a file stream is being written to midstream. That means you'll end up with a corrupt file. One way to get around this is to think transactionally about it; do not replace the actual file unless the writing was ok.
In .NET this means we can do a File.Replace() if the file exists already - or a File.Move()if its an entirely new file.
The following code is an example of how this can be done.
There are situations where a program might crash while a file stream is being written to midstream. That means you'll end up with a corrupt file. One way to get around this is to think transactionally about it; do not replace the actual file unless the writing was ok.
In .NET this means we can do a
File.Replace()
if the file exists already - or aFile.Move()
if its an entirely new file.The following code is an example of how this can be done.
┆Issue is synchronized with this Asana task
The text was updated successfully, but these errors were encountered: