Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fclose(3) — CLIX 3.1r7.6.22

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close(2)

exit(2)

fopen(3)

setbuf(3)

stdio(3)



  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




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