Mercurial > hg > Members > kono > nitros9-code
view docs/ccguide/fclose.refentry @ 2798:b70d93f8d7ce lwtools-port
Updated coco1/modules/makefile and coco3/modules/makefile to help resolve issues with i(x) and s(x) descriptors.
Updated level1/coco1/modules/makefile & level2/coco3/modules/makefile
so that correct values would be sent to assembler when
building superdesc.asm for s(x).dd and i(x).dd descriptors.
author | drencor-xeen |
---|---|
date | Mon, 28 Jan 2013 16:13:05 -0600 |
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>