mhg@lance.hss.bu.oz.au (Miles Gillham) (11/29/90)
In article <1778@mts.ucs.UAlberta.CA> userBARD@mts.ucs.UAlberta.CA (Barry Ard) writes: >... >happen. It is my understanding that the fflush() should force the buffers >to be written to disk. Am I mistaken? I don't want to have to >open, write, close, the re-open the file, it seems so kludgy and >defeats the purpose of why I am flushing in the first place. You are not mistaken that the flush forces the buffers to disk but it takes a close or something better to make sure that the DOS dir and FAT info is also committed. The "something better" is a DOS call introduced in version 3.3 by the name of "68h Commit File". It was added to DOS for the very reason of avoiding a close/open sequence every time you wanted to force the data to be persistent in the case of some disaster. You will need to set up a DOS INT 21h call with the following registers on entry: AX - 68h BX - DOS File Handle No return values except normal DOS error codes. Regards, Miles of Smiles -- Language Centre E-mail: mhg@lance.hss.bu.oz.au Bond University, Gold Coast, QLD 4229 Phone: +61 75 952524 Australia Fax: +61 75 952545