view docs/ccguide/fclose.refentry @ 2772:0a3f4d8ea6d5

Found ENDC in wrong location in dwread.asm and dwwrite.asm. Corrected. Moved the native 6309 code in dwread.asm and dwwrite.asm into the H6309 labeled area and changed IFEQ H6309 to IFNE H6309. Also moved the 57600bps 6809 code to the default location. This change had been done in the old dwread.asm and dwwrite.asm files to make it easier to follow. Though these two files were overwritten from the HDBDOS project dwread.asm and dwwrite.asm files. So this conversion needed to be done again so it made the source easier to follow.
author drencor-xeen
date Wed, 23 Jan 2013 12:36:55 -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 &lt;stdio.h&gt;
</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>