Performing Safe File I/O After an Inadvertent Closing of a Data File Under IBM DOS
Original Publication Date: 1987-Nov-01
Included in the Prior Art Database: 2005-Feb-02
A data file opened by one program under IBM DOS can be inadvertently closed by the termination of another program. If this condition occurs, the data file is reopened and processing continues. Whenever several programs install themselves resident under IBM DOS, DOS treats all of the programs as a single large program. If one of the programs is terminated, all files opened by all of the programs constituting the single large program are closed. This condition is detected by using the 16 bit file "handle" returned by DOS whenever a program opens a file. The program then writes this quantity to a fixed location "mailbox" in memory. All file close calls to the DOS must be intercepted. If the file about to be closed is the file whose "handle" is in the "mailbox," then a flag is set.