@(#)fclose.3 6.2 (Berkeley) 12/16/88
FCLOSE 3S ""
.AT 3
NAME
fclose, fflush - close or flush a stream
SYNOPSIS
#include <stdio.h> fclose(stream)
FILE *stream;
fflush(stream)
FILE *stream;
fpurge(stream)
FILE *stream;
DESCRIPTION
Fclose causes any buffers for the named
stream to be emptied, and the file to be closed.
Buffers allocated by the standard input/output system
are freed.
Fclose is performed automatically upon calling exit (3).
Fflush causes any buffered data for the named output stream to be written to that file. The stream remains open.
Fpurge causes any buffered data for the named stream to be lost. The stream remains open.
"SEE ALSO"
close(2), fopen(3), setbuf(3)
DIAGNOSTICS
These routines return
EOF if
stream is not associated with an output file, or
if buffered data cannot be transferred to that file.