Article View: comp.os.os2.programmer
Article #2824Re: How do I flush disk buffer?
From: Dimitri Vulis
Date: Mon, 14 Dec 1992 07:50
Date: Mon, 14 Dec 1992 07:50
11 lines
941 bytes
941 bytes
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
Technical Details
Message-ID:
<92349.025025DLVGC@CUNYVM.BITNET>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!swrinde!gatech!news.byu.edu!hamblin.math.byu.edu!yvax.byu.edu!cunyvm!dlvgcReferences:
<1992Dec3.012008.27192@networx.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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