Function Reference
— Built-in Function: fflush (fid)

Flush output to fid. This is useful for ensuring that all pending output makes it to the screen before some other event occurs. For example, it is always a good idea to flush the standard output stream before calling input.

fflush returns 0 on success and an OS dependent error value (−1 on unix) on error.

See also: fopen fclose