Path: utzoo!attcan!uunet!peregrine!elroy.jpl.nasa.gov!usc!apple!portal!cup.portal.com!ekalenda From: ekalenda@cup.portal.com (Edward John Kalenda) Newsgroups: comp.os.msdos.programmer Subject: Re: Flushing and Database Integrity Message-ID: <36582@cup.portal.com> Date: 5 Dec 90 19:51:16 GMT References: <19720001@hpctdkg.HP.COM> Organization: The Portal System (TM) Lines: 22 Kevin Dietz writes: > This is a follow-up note to Turbo C++ fopen() and fflush(). I have > read all of the posted responses and understand the issues involved. > The question I have involves how DOS manipulates its internal buffers, > specifically, does DOS guarentee that file writes are performed in > the same order as the original write operations from the C program > when the file is closed/flushed? The reason for this is that I am > trying to develop algorithms that will insure the integrity of a database, > but everything I come up with seems to have this requirement. The DOS buffers are used as a write-through cache so the order or disk writes will always be the same as calls to DOS to write a disk block. This statement is based on claims made in the MS-DOS Encyclopedia where it discusses the BUFFER statement in the config.sys file. Reading about the commit system call (int 21h function 68h) says it forces all buffers for the file to be written and updates the FAT and directory data. BUFFERS docs say there are no dirty buffers, commit docs imply there might be. I'd call the commit function anytime I'm worried about file integrity. Ed ekalenda@cup.portal.com