home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- 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
- From: lionel@quark.enet.dec.com (Steve Lionel)
- Subject: Re: Help to flush buffer in FORTRAN. (REPOST)
- Message-ID: <1992Dec13.220730.27954@e2big.mko.dec.com>
- Sender: usenet@e2big.mko.dec.com (Mr. USENET)
- Organization: Digital Equipment Corporation
- References: <1992Dec8.124335.1@lure.latrobe.edu.au> <588@cfdd40.boeing.com>
- Date: Sun, 13 Dec 1992 22:11:57 GMT
- Lines: 34
-
-
- In article <588@cfdd40.boeing.com>, lry1219@cfdd40.boeing.com
- (Larry Yeagley) writes...
- >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.
- >
-
- I don't recommend this; ENDFILE is defined as "writing an endfile record",
- and if it happens to do a flush at the same time, that is an implementation
- detail. ENDFILE doesn't do a flush in VAX FORTRAN (which is what the
- original questioner was using.)
-
- Steve Lionel lionel@quark.enet.dec.com
- SDT Languages Group
- Digital Equipment Corporation
- 110 Spit Brook Road
- Nashua, NH 03062
-