🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #1058

Re: Turbo C++ fopen() & fflush()

#1058
From: Miles Gillham
Date: Wed, 28 Nov 1990 22:22
30 lines
1705 bytes
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
Technical Details
Message-ID: <9509@lance.hss.bu.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!lance!mhg
References: <1778@mts.ucs.UAlberta.CA>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!lance!mhg
From: mhg@lance.hss.bu.oz.au (Miles Gillham)
Newsgroups: comp.sys.ibm.pc.programmer,comp.os.msdos.programmer
Subject: Re: Turbo C++ fopen() & fflush()
Message-ID: <9509@lance.hss.bu.oz.au>
Date: 28 Nov 90 22:22:29 GMT
References: <1778@mts.ucs.UAlberta.CA>
Reply-To: mhg@lance.hss.bu.oz.au (Miles Gillham)
Organization: Language Centre, Bond University, Australia.
Lines: 30