diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2003-04-15 22:38:47 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2003-04-15 22:38:47 +0000 |
commit | bafa3c3c06c25c6e6a7452675e3ddf6a393368d7 (patch) | |
tree | 8ea1527fa5014d95106306a8eb1b3308e622d13b | |
parent | 0b78a9b6a0599e01fd2415f09422f73a26e14fcd (diff) | |
download | gcc-bafa3c3c06c25c6e6a7452675e3ddf6a393368d7.zip gcc-bafa3c3c06c25c6e6a7452675e3ddf6a393368d7.tar.gz gcc-bafa3c3c06c25c6e6a7452675e3ddf6a393368d7.tar.bz2 |
re PR libstdc++/9423 (filebuf::pubsetbuf(0, 0) doesn't turn off buffering if called after open)
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/docs/html/27_io/howto.html | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2cd9558..0f3232d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/docs/html/27_io/howto.html b/libstdc++-v3/docs/html/27_io/howto.html index c8538a6..5cf4f4f 100644 --- a/libstdc++-v3/docs/html/27_io/howto.html +++ b/libstdc++-v3/docs/html/27_io/howto.html @@ -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 ("/foo/bar/baz"); - std::ifstream is ("/qux/quux/quuux"); + std::ofstream os; + std::ifstream is; int i; os.rdbuf()->pubsetbuf(0,0); is.rdbuf()->pubsetbuf(0,0); + + os.open("/foo/bar/baz"); + is.open("/qux/quux/quuux"); ... os << "this data is written immediately\n"; is >> i; // and this will probably cause a disk read </pre> |