Mail Archives: djgpp/1999/12/09/08:10:32
"Chris Underwood" <underwoodc AT logica DOT nospam DOT com> writes:
> I'm currently developing a DOS based mp3 player (eventually to be used as a
> car stereo), and testing it as I go in a DOS box under Win95. As with most
> developments, my program crashes sometimes (probably a buffer over-run on a
> large array). When the program crashes, it occasionally destroyes the text
> files it happens to have open, either replacing them with a series of
> repeating bytes or blanking them completely. This is strange, since the
> program only ever opens files using the following:
>
> infile = fopen(filename, "r");
>
> Note the open mode is "r", for read access only. How can a program crash
> damage files that are never written to, or even open for writing?
If you crash badly enough, you can overwrite the disk cache. This is
bad, and can cause corruption like you mention.
I don't know if this is what's happening in your case, but it's one
scenario where such a thing might happen.
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -