Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 157 -
------------------------------------------------------------------------------
6.5 Flush a stream buffer
. <Main,Alarm,Comm>
------------------------------------------------------------------------------
[Name]
fflush
[Syntax]
#include <stdio.h>
int fflush( FILE *stream ) ;
[Arguments]
stream Pointer to a FILE structure.
[Return]
Returns zero if a buffer has been successfully flushed. Also if
specified stream has no buffer, or it has been opened with Read-Only
mode, returns zero. If any error occurs, returns EOF. In this case,
any data may be missed because of incorrect writing.
[Description]
Flushes specified stream. If specified stream has been opened for
output, contents of the buffer are written to the file. If for input,
they are cleard. All streams for output are flushed by specifying
NULL in argument. Steams will still exist as they are after calling
"fflush". Calling "fflush" makes the result of "ungetc" ineffective.
Buffers are automatically flushed when a buffer is full, a stream is
closed, or program successfully terminated without closing streams.
This function does not influence to the streams without buffering.