home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4680 < prev    next >
Encoding:
Internet Message Format  |  1992-12-12  |  1.4 KB

  1. Path: sparky!uunet!bcstec!cfdd40!lry1219
  2. From: lry1219@cfdd40.boeing.com (Larry Yeagley)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: Help to flush buffer in FORTRAN.  (REPOST)
  5. Summary: flushing buffers in FORTRAN sans CLOSEing or REWINDing
  6. Message-ID: <588@cfdd40.boeing.com>
  7. Date: 12 Dec 92 00:06:14 GMT
  8. References: <1992Dec8.124335.1@lure.latrobe.edu.au>
  9. Organization: Boeing Computer Services, Seattle - CFD lab
  10. Lines: 25
  11.  
  12. In article <1992Dec8.124335.1@lure.latrobe.edu.au>, tspdlr@lure.latrobe.edu.au writes:
  13.  
  14.    [stuff deleted]
  15.  
  16. > until it finishes.  Since my program takes many hours to complete I want
  17. > to force the buffered output data to the output file periodically to 
  18. > ensure minimal data loss in case of a system crash/failure.
  19. > I have thought about periodically closing and re-opening the files but 
  20. > don't really like this as a solution.
  21.  
  22. Consider using the command "ENDFILE (unit)" to flush output buffer of "unit".
  23. I have used it on several platforms and it seems to work. Typically, I use it
  24. when I have catastrophic program crashes - those for which no error traceback
  25. is available. Such crashes often leave data in the buffers. To insure that the
  26. data is pushed out I insert ENDFILE after each WRITE in the suspected region.
  27. Then, when the crash comes, I am assured that I know the last bit of data that
  28. was written.
  29.  
  30. Note that ENDFILE does not reposition the file whereas CLOSE & REWIND do.
  31.  
  32.  
  33. Larry Yeagley
  34. lry1219@cfdd42.boeing.com
  35.