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