|
If stream points to an output stream or an update
stream in which the most recent operation was not input, fflush() causes any unwritten data for that stream to be written to the file, and the st_ctime and st_mtime fields of the underlying file are marked for update.
If stream is a null pointer, fflush() performs this flushing action on all streams for which the behavior is defined above. Additionally, an input stream or an update stream into which the most recent operation was input is also flushed if it is seekable
and is not already at end-of-file. Flushing an input stream discards any buffered input and adjusts the file pointer such that the next input operation accesses the byte after the last one read. A stream is seekable if the underlying file is not a pipe, FIFO, socket, or TTY device. An input stream,
seekable or non-seekable, can be flushed by explicitly calling fflush() with a non-null argument specifying that stream.
|