XL Fortran for AIX 8.1

User's Guide


Flushing I/O Buffers

To protect data from being lost if a program ends unexpectedly, you can use the flush_ subroutine to write any buffered data to a file:

USE XLFUTILITY
PARAMETER (UNIT=10)
 
DO I=1,1000000
    WRITE (10,*) I
    CALL MIGHT_CRASH
! If the program ends in the middle of the loop, some data
! may be lost.
END DO
 
DO I=1,1000000
    WRITE (10,*) I
    CALL FLUSH_(UNIT)
    CALL MIGHT_CRASH
! If the program ends in the middle of the loop, all data written
! up to that point will be safely in the file.
END DO
 
END
Related Information:
See Mixed-Language Input and Output.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]