home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!swrinde!gatech!news.byu.edu!hamblin.math.byu.edu!yvax.byu.edu!cunyvm!dlvgc
- Newsgroups: comp.os.os2.programmer
- Subject: Re: How do I flush disk buffer?
- Message-ID: <92349.025025DLVGC@CUNYVM.BITNET>
- From: Dimitri Vulis <DLVGC@CUNYVM.BITNET>
- Date: Monday, 14 Dec 1992 02:50:25 EST
- References: <1992Dec3.012008.27192@networx.com>
- Organization: City University of New York/ University Computer Center
- Lines: 11
-
- I've had a similar problem (keeping the log file in the event the power
- goes off) and simply calling fflush(fptr) after every fprintf seems to
- commit the data to disk right away. (Including writing over a LAN Server
- to a networked disk). I even wrote a little function wrlog using stdargs
- that first passes its args to fprintf(logfptr, then fflush(logfpr)'s.
-
- Of course, fflush _may_ work differently under gcc (I tried this with
- both icc and ms c 6.0)
-
- Hope this helps,
- Dimitri
-