This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Doc patch] For libstdc++/9423


Hi,

the below is a doc patch resulting from Benjamin's analysis
in the audit trail.

Ok?

Paolo.

/////////
2003-04-15  Benjamin Kosnik  <bkoz at redhat dot com>
	    Paolo Carlini  <pcarlini at unitus dot it>

	PR libstdc++/9423
	* docs/html/27_io/howto.html
	('The buffering is screwing up my program!'): Explain that
	opening counts as an I/O operation.
--- howto.html.~1.24.~	2003-02-04 19:24:07.000000000 +0100
+++ howto.html	2003-04-15 13:18:01.000000000 +0200
@@ -159,15 +159,18 @@
       because the data needs to appear quickly (a prime example is a
       log file for security-related information).  The way to do this is
       just to turn off the buffering <em>before any I/O operations at
-      all</em> have been done, i.e., as soon as possible after opening:
+      all</em> have been done (note that opening counts as an I/O operation):
    </p>
    <pre>
-   std::ofstream    os (&quot;/foo/bar/baz&quot;);
-   std::ifstream    is (&quot;/qux/quux/quuux&quot;);
+   std::ofstream    os;
+   std::ifstream    is;
    int   i;
 
    os.rdbuf()-&gt;pubsetbuf(0,0);
    is.rdbuf()-&gt;pubsetbuf(0,0);
+
+   os.open(&quot;/foo/bar/baz&quot;);
+   is.open(&quot;/qux/quux/quuux&quot;);
    ...
    os &lt;&lt; &quot;this data is written immediately\n&quot;;
    is &gt;&gt; i;   // and this will probably cause a disk read </pre>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]