home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / os2 / programm / 6993 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  920 b 

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