annotate docs/ccguide/fclose.refentry @ 691:ddf512f635d2

Ever so closer
author boisy
date Mon, 30 Dec 2002 03:52:24 +0000
parents c0da1728ed5b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
570
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
1 <refentry id="fclose">
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
2 <refnamediv>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
3 <refname>Fclose</refname>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
4 <refname>Fflush</refname>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
5 <refpurpose>flush or close a file</refpurpose>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
6 </refnamediv>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
7
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
8 <refsynopsisdiv>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
9 <funcsynopsis>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
10 <funcsynopsisinfo>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
11 #include &lt;stdio.h&gt;
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
12 </funcsynopsisinfo>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
13
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
14 <funcprototype>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
15 <funcdef><function>fclose</function></funcdef>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
16 <paramdef>FILE *<parameter>fp</parameter></paramdef>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
17 </funcprototype>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
18
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
19 <funcprototype>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
20 <funcdef><function>fflush</function></funcdef>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
21 <paramdef>FILE *<parameter>fp</parameter></paramdef>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
22 </funcprototype>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
23
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
24 </funcsynopsis>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
25
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
26 </refsynopsisdiv>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
27
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
28 <refsect1><title>Description</title>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
29 <para>
594
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
30 Fflush causes a buffer associated with the file pointer "fp"
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
31 to be cleared by writing out to the file; of course, only if
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
32 the file was opened for write or update. It is not normally
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
33 ncesasary to call fflush, but it can be useful when, for
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
34 example, normal output is to "stdout", and it is wished to
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
35 send something to "stderr" which is unbuffered. If fflush
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
36 were not used and "stdout" referred to the terminal, the
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
37 "stderr" message will appear before large chunks of the
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
38 "stdout" message even though the latter was written first.
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
39 </para>
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
40 <para>
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
41 Fclose call fflush to clear out the buffer associated with
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
42 "fp", closes the file, and frees the buffer for use by another
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
43 fopen call.
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
44 </para>
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
45 <para>
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
46 The exit() system call and normal termination of a program
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
47 causes fclose to be called for each open file.
570
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
48 </para>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
49 </refsect1>
594
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
50
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
51 <refsect1><title>See Also</title>
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
52 <para>
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
53 System call
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
54 <link linkend="close">close()</link>,
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
55 <link linkend="fopen">fopen()</link>,
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
56 <link linkend="setbuf">setbuf()</link>.
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
57 </para>
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
58 </refsect1>
c0da1728ed5b All refentries finished.
roug
parents: 570
diff changeset
59
570
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
60 <refsect1><title>Diagnostics</title>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
61 <para>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
62 EOF is returned if "fp" does not refer to an output file or
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
63 there is an error writing to the file.
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
64 </para>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
65 </refsect1>
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
66
253b6096ee01 All function prototypes are added.
roug
parents:
diff changeset
67 </refentry>