Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Large stream buffers Message-ID: <772@taumet.com> Date: 18 Jun 91 17:01:41 GMT References: <1991Jun17.171623.6730@NCoast.ORG> Organization: Taumetric Corporation, San Diego Lines: 17 dale@NCoast.ORG (Dale Smith) writes: >How can I prevent an ofstream from flushing it's buffer until it's >full? In Borland C++, if I allocate a larger buffer (say 32k or so), >I still seem to be doing a lot more writes to disk than necessary. Check the buffering flags ios::stdio and ios::unitbuf for the various output streams. If the stdio flag for a stream S is set, cout and cerr are flushed each time anything is written to stream S. If the unitbuf flag for a stream S is set, S is flushed every time something is written to it. -- Steve Clamage, TauMetric Corp, steve@taumet.com