DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

fclose(S-osr5)


fclose, fflush -- close or flush a stream

Syntax

cc . . . -lc

#include  <stdio.h>

int fclose (stream) FILE *stream;

int fflush (stream) FILE *stream;

Description

The fclose function causes any buffered data for the named stream to be written out, and the stream to be closed.

The fclose function is performed automatically for all open files upon calling exit.

fflush causes any buffered data for the named stream to be written to that file. The stream remains open.

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.

See also

close(S-osr5), exit(S-osr5), fopen(S-osr5), setbuf(S-osr5), stdio(S-osr5)

Standards conformance

fclose and fflush are conformant with:

X/Open Portability Guide, Issue 3, 1989 ;
ANSI X3.159-1989 Programming Language -- C ;
Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2) ;
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1) ;
and NIST FIPS 151-1 .


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005