Mercurial > hg > Members > kono > nitros9-code
view docs/ccguide/fclose.refentry @ 3140:03b580a02945
Allow CoCo3FPGA-specific build of superdesc.asm
Added new conditional CC3FPGA and code to "level1/modules/superdesc.asm"
to reflect changes needed to build the new SD card descriptors for the
Coco3FPGA.
author | Bill Pierce <merlinious999@gmail.com> |
---|---|
date | Sat, 04 Feb 2017 11:06:26 +0100 |
parents | c0da1728ed5b |
children |
line wrap: on
line source
<refentry id="fclose"> <refnamediv> <refname>Fclose</refname> <refname>Fflush</refname> <refpurpose>flush or close a file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> #include <stdio.h> </funcsynopsisinfo> <funcprototype> <funcdef><function>fclose</function></funcdef> <paramdef>FILE *<parameter>fp</parameter></paramdef> </funcprototype> <funcprototype> <funcdef><function>fflush</function></funcdef> <paramdef>FILE *<parameter>fp</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1><title>Description</title> <para> Fflush causes a buffer associated with the file pointer "fp" to be cleared by writing out to the file; of course, only if the file was opened for write or update. It is not normally ncesasary to call fflush, but it can be useful when, for example, normal output is to "stdout", and it is wished to send something to "stderr" which is unbuffered. If fflush were not used and "stdout" referred to the terminal, the "stderr" message will appear before large chunks of the "stdout" message even though the latter was written first. </para> <para> Fclose call fflush to clear out the buffer associated with "fp", closes the file, and frees the buffer for use by another fopen call. </para> <para> The exit() system call and normal termination of a program causes fclose to be called for each open file. </para> </refsect1> <refsect1><title>See Also</title> <para> System call <link linkend="close">close()</link>, <link linkend="fopen">fopen()</link>, <link linkend="setbuf">setbuf()</link>. </para> </refsect1> <refsect1><title>Diagnostics</title> <para> EOF is returned if "fp" does not refer to an output file or there is an error writing to the file. </para> </refsect1> </refentry>