This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Attaching cout || cerr to an ostream


Hello all,

Anyone know how to attach cout or cerr (fd 1 or fd 2) to an ostream ?

I was used to do something like this with the old libstdc++ :

------------------------------------------------
	ofstream	l_try;
	string	l_output;

	if ( l_output == "cerr" )
		l_try.attach( 2 );
	else if ( l_output == "cout" )
		l_try.attach( 1 );
	else
		l_try.open( l_output.c_str() );
------------------------------------------------

It's seems that ostream::attach is no more present. How do I achieve
the same thing with libstdc++-v3 ?

Thanks

Laurent Marzullo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]