Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close(2)

exit(3)

fopen(3S)

setbuf(3S)

FCLOSE(3S)  —  STANDARD I/O FUNCTIONS

NAME

fclose, fflush − close or flush a stream

SYNOPSIS

#include <stdio.h>

fclose(stream)
FILE ∗stream;

fflush(stream)
FILE ∗stream;

DESCRIPTION

fclose() writes out any buffered data for the named stream, and closes the named stream.  Buffers allocated by the standard input/output system are freed. 

fclose() is performed automatically for all open files upon calling exit(3). 

fflush() writes out any buffered data for the named output stream.  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 4.0  —  Last change: 6 October 1987

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026