Hi,
I'm using file_descriptor_sink to obtain a stream to a given file
handle. It's important that the file remain open past the lifetime of
that object, so I send in false as the second parameter to the
constructor (close_on_exit). It seems the file is being closed anyway.
Here is an example:
#include <iostream>
#include
#include
int main(int argc, const char *argv[])
{
std::cout << "foo" << std::endl;
{
boost::iostreams::streamboost::iostreams::file_descriptor_sink
stream(fileno(stdout), false);
stream << "bar" << std::endl;
}
std::cout << "baz" << std::endl;
return 0;
}
Here we expect
foo
bar
baz
to be written, when only
foo
bar
is written. Note that the output is the same regardless of whether true
or false is sent into the constructor.
Is this a boost bug, or is there something I'm missing here?
I'm using gcc 4.3.4 on Ubuntu 10.04 if that makes any difference.
Thanks,
Scott Quiring