www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/08/21:09:40

From: "Chris Underwood" <underwoodc AT logica DOT nospam DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Corruption of read-only files on program crash
Date: Wed, 8 Dec 1999 09:33:40 -0000
Organization: Logica UK Ltd.
Lines: 16
Message-ID: <82l8ll$4h2@romeo.logica.co.uk>
NNTP-Posting-Host: 158.234.18.170
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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?

Chris


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019