fclose(3) CLIX fclose(3)
NAME
fclose, fflush - Closes or flushes a stream
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <stdio.h>
int fclose(
FILE *stream );
int fflush(
FILE *stream );
PARAMETERS
stream Points to a stream.
DESCRIPTION
The fclose() function causes any buffered data for the named stream to be
written out, and the stream to be closed.
The effects performed by the fclose() function are carried out
automatically for all open files upon calling exit().
The fflush() causes any buffered data for the named stream to be written
to that file. The stream remains open.
EXAMPLES
To close a file:
FILE *instream;
instream=fopen("input/data","r");
...
fclose(instream);
RETURN VALUES
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.
RELATED INFORMATION
Functions: close(2), exit(2), fopen(3), setbuf(3), stdio(3)
2/94 - Intergraph Corporation 1