Boost logo

Boost Users :

Subject: Re: [Boost-users] [iostreams] why doesn't file_sink flush?
From: eg (egoots_at_[hidden])
Date: 2009-05-04 19:43:27


Andrew Schweitzer wrote:
> I'm trying to chain debugging logs together with a filtering_ostream.
> I've discovered that I need to call flush() on the filtering_ostream to
> get characters to appear in console in a timely fashion. This flush()
> call doesn't causes the file to be flushed. After some digging, I've
> discovered that the boost::iostreams::file_sink doesn't have the
> flushable_tag (or implement flush). std::fstream does have a flush
> function, and if I use it directly (not chained into a
> filtering_ostream), the flush call works as you might expect.
>
> So what is the appropriate way of implementing this? Chaining multiple
> logs together seems like a great way to use iostreams library. And out
> of curiosity, why doesn't file_sink implement flushable_tag?
>

I am not sure if it is exactly your case, but you may wish to read the
thread at:
http://thread.gmane.org/gmane.comp.lib.boost.user/33355

In particular, read the posts by Jonathan Turkanis (iostreams author).
It may (or may not?) shed some additional light on flush and your needs.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net