Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fflush(3S) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close(2)

exit(2)

fopen(3S)

setbuf(3S)

FCLOSE(3S)

NAME

fclose, fflush − close or flush a stream

SYNOPSIS

#include <stdio.h>

int fclose (stream)
FILE ∗stream;

int fflush (stream)
FILE ∗stream;

DESCRIPTION

Fclose causes any buffered data for the named stream to be written out, and the stream to be closed.  Buffers allocated by the standard input/output system may be freed. 

Fclose is performed automatically for all open files upon calling exit(2).

If stream points to an output stream or an update stream in which the most recent operation was output, fflush causes any buffered data for the stream to be written to that file; otherwise any buffered data is discarded.  The stream remains open. 

If stream is a null pointer, the fflush function performs this flushing action on all currently open streams. 

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(2), exit(2), fopen(3S), setbuf(3S). 

STANDARDS CONFORMANCE

fclose: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1, ANSI C

fflush: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1, ANSI C

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

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