flush

Date:

10-20-2011

NAME

FLUSH - Writes data buffered by Fortran output statements to a file

SYNOPSIS

CALL FLUSH(iunit)
CALL FLUSH(iunit,[istat]

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

FLUSH writes to a file any buffered data previously written by Fortran output statements. FLUSH may be called after reading or writing. The current file position is not changed.

When using the Cray Fortran compiler, all arguments must be of default kind unless documented otherwise. The default kind is KIND=4 for integer, real, complex, and logical arguments.

This routine has the following arguments:

iunit

Integer KIND=4 variable, expression, or constant containing a Fortran unit number. If this value is 101, it flushes the unit which is connected to standard output. If this value is 102, it flushes the unit which is connected to standard error.

istat

Integer KIND=4 variable or array element that receives the return status as follows:

=0

Indicates that all buffered data, if any, was flushed. A file that was immediately read, or a file with a buffer that has not changed since the last flush, might return a 0 status even though no new data would be written to the file.

-1

Indicates that the Fortran unit does not support FLUSH, and no data was written to the file.

>0

Indicates that an error condition was encountered. The specific error number is returned. Use the explain(1) command for a description of the error code.

The istat argument is optional; the user program is aborted if FLUSH is called without istat and an error condition is encountered.

NOTES

The FLUSH command does not support sequential unformatted files.

If FLUSH is called with an unconnected unit, an error condition results (except for units 101 and 102). Calling FLUSH for a file for which the program does not have write permission returns a 0 status if no data was written to that file previously with Fortran I/O statements.

A WRITE I/O statement with an asterisk unit identifier (or a PRINT statement) uses unit 101. See “Fortran I/O Units” in the intro_io(3f) man page for more information.

SEE ALSO

explain(1)