re PR libstdc++/9423 (filebuf::pubsetbuf(0, 0) doesn't turn off buffering if called...
authorBenjamin Kosnik <bkoz@redhat.com>
Tue, 15 Apr 2003 22:38:47 +0000 (22:38 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 15 Apr 2003 22:38:47 +0000 (22:38 +0000)
2003-04-15  Benjamin Kosnik  <bkoz@redhat.com>
    Paolo Carlini  <pcarlini@unitus.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.

Co-Authored-By: Paolo Carlini <pcarlini@unitus.it>
From-SVN: r65665

libstdc++-v3/ChangeLog
libstdc++-v3/docs/html/27_io/howto.html

index 2cd955819da6f700fcaccd04a4201dfd467d8282..0f3232d4dde29f99b946a93df0b5c9aad2a4c7f4 100644 (file)
@@ -1,3 +1,11 @@
+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.
+
 2003-04-15  Andreas Tobler  <a.tobler@schweiz.ch>
 
        * testsuite/thread/pthread1.cc: Enable for darwin test.
index c8538a6f6395acc1f3f1ad40a17687bd763f1c50..5cf4f4f05ef4e636fd57a05960d0bc7eb6821b68 100644 (file)
       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>