FCLOSE(3S) — STANDARD I/O LIBRARY
NAME
fclose, fflush − close or flush a stream
SYNOPSIS
#include <stdio.h>
fclose(stream)
FILE ∗stream;
fflush(stream)
FILE ∗stream;
DESCRIPTION
fclose causes any buffered data for the named stream to be written out, and the named stream to be closed. Buffers allocated by the standard input/output system are freed.
fclose is performed automatically for all open files upon calling exit(3).
fflush causes any buffered data for the named output stream to be written out. The named stream remains open.
SEE ALSO
close(2), exit(3), fopen(3S), setbuf(3S)
DIAGNOSTICS
These functions return 0 for success, and EOF if any error (such as trying to write to a file that has not been opened for writing) was detected.
Sun Release 3.2 — Last change: 15 April 1986