home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4689 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.9 KB  |  46 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!dbased.nuo.dec.com!nntpd.lkg.dec.com!e2big.mko.dec.com!quark.enet.dec.com!lionel
  3. From: lionel@quark.enet.dec.com (Steve Lionel)
  4. Subject: Re: Help to flush buffer in FORTRAN.  (REPOST)
  5. Message-ID: <1992Dec13.220730.27954@e2big.mko.dec.com>
  6. Sender: usenet@e2big.mko.dec.com (Mr. USENET)
  7. Organization: Digital Equipment Corporation
  8. References: <1992Dec8.124335.1@lure.latrobe.edu.au> <588@cfdd40.boeing.com>
  9. Date: Sun, 13 Dec 1992 22:11:57 GMT
  10. Lines: 34
  11.  
  12.  
  13. In article <588@cfdd40.boeing.com>, lry1219@cfdd40.boeing.com 
  14. (Larry Yeagley) writes...
  15. >In article <1992Dec8.124335.1@lure.latrobe.edu.au>, tspdlr@lure.latrobe.edu.au writes:
  16. >   [stuff deleted]
  17. >> until it finishes.  Since my program takes many hours to complete I want
  18. >> to force the buffered output data to the output file periodically to 
  19. >> ensure minimal data loss in case of a system crash/failure.
  20. >> 
  21. >> I have thought about periodically closing and re-opening the files but 
  22. >> don't really like this as a solution.
  23. >> 
  24. >Consider using the command "ENDFILE (unit)" to flush output buffer of "unit".
  25. >I have used it on several platforms and it seems to work. Typically, I use it
  26. >when I have catastrophic program crashes - those for which no error traceback
  27. >is available. Such crashes often leave data in the buffers. To insure that the
  28. >data is pushed out I insert ENDFILE after each WRITE in the suspected region.
  29. >Then, when the crash comes, I am assured that I know the last bit of data that
  30. >was written.
  31.  
  32. I don't recommend this; ENDFILE is defined as "writing an endfile record",
  33. and if it happens to do a flush at the same time, that is an implementation
  34. detail.  ENDFILE doesn't do a flush in VAX FORTRAN (which is what the
  35. original questioner was using.)
  36.  
  37. Steve Lionel                    lionel@quark.enet.dec.com
  38. SDT Languages Group
  39. Digital Equipment Corporation
  40. 110 Spit Brook Road
  41. Nashua, NH 03062
  42.