Control ofstream buffering?

I

idesilva

Hi,

I have an app that generates a text log at a very high rate. Currently
I use an ofstream object to write the log. I would like to control when
'exactly' the log is written to the disk. Also I want to be able to
reset the buffer contents without writing them to the disk file.

- Can the 'buffer size' of an ofstream object (in fact, any iostream
lib object) be controlled?
- Can we control *when* the buffer is flushed? [I want ofstream to
flush *only* when I invoke flush(). The default 'nounitbuf' behavior
doesn't do what I want]
- Is there a way to *reset* the ofstream buffer?

Thanks,
Ishan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top