Common Problems with Binary Files
If the data is expected to fall into a known range of values,
then a program can check for valid input values.
Sometimes other things are known about the data
that can be used to check it.
But otherwise, there is usually no way to check.
Bytes written in one format can usually
be mistakenly read with another.
You have to be sure that the data file and the program match.
This is a common problem in programming.
Some files are many years old and were
created with poorly documented programs running
on now obsolete computers.
Figuring out how to read them is often a
case of detective work.
Often a file will have a header that describes
its data.
Programs that read the file check the header to
verify that the file is what they expect.
It is common for the header to included the
date of its creation and the
version
number of the program that created it.
|