Checking a file for corruption before "loading"?
Posted: Fri Feb 20, 2009 2:47 pm
When someone creates a "tournament" using our standalone application, we create two files that make up that tournament - one for participants, one for brackets. We save them both as ".rev" files. This is the method we've used since 2003, and it seems to work fine.
Recently, there have been a couple of instances of these tournament files becoming corrupted, either when being sent via email, or when someone makes a "backup copy" and moves it to another machine.
The challenge this creates is the standalone built with Rev 3.0 can't proceed with a file corrupted like this, it just hangs, or worse, crashes (but the "hang" seems more common).
Opening the stack directly (not via my application) in the development environment for 3.0 produces a Rev crash. Opening the stack directly in the devlopment environment for 3.5 produces the error dialog "this file is corrupted, please check for a ~ file". These files have cleared all virus scanners successfully.
So, to the question: is there a way for me to open a file as binary, checksum it, verify that it is okay, and then either report it as corrupt or proceed? These crashes make people believe my program is misbehaving, when it _seems_ to me that it's out of my control.
Thanks in advance.
Recently, there have been a couple of instances of these tournament files becoming corrupted, either when being sent via email, or when someone makes a "backup copy" and moves it to another machine.
The challenge this creates is the standalone built with Rev 3.0 can't proceed with a file corrupted like this, it just hangs, or worse, crashes (but the "hang" seems more common).
Opening the stack directly (not via my application) in the development environment for 3.0 produces a Rev crash. Opening the stack directly in the devlopment environment for 3.5 produces the error dialog "this file is corrupted, please check for a ~ file". These files have cleared all virus scanners successfully.
So, to the question: is there a way for me to open a file as binary, checksum it, verify that it is okay, and then either report it as corrupt or proceed? These crashes make people believe my program is misbehaving, when it _seems_ to me that it's out of my control.
Thanks in advance.