Mail Archives: djgpp/1999/12/09/08:27:41
Chris Underwood (underwoodc AT logica DOT nospam DOT com) wrote:
[...]
> 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.
[...]
As Nate and Eli already pointed out, your program just may be
corrupting the disk cache. OTOH, even that alone shouldn't effect the
data on the disk, yet, for a file opened in readonly mode (DOS/Windows
*does* distinguish between open for read and open for write, doesn't
it?) Not unless your program by extremely bad luck manages to modify
the internal data structures of the cache without corrupting them,
thus turning read-only cache contents into write-behind, 'dirty'
content that has to be written back to disk.
Another thing to keep in mind: off the shelf, a DJGPP program wouldn't
normally be able to commit this kind of trespass, due to the memory
protection offered by protected mode. Does your program use the
nearptr method, by any chance? If so, stop doing that, and the problem
might just go away... nearptr *is* fundamentally unsafe, after all.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -