Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C Moderated > Re: How should ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 1082 of 1126
Post > Topic >>

Re: How should I reopen stdout, so that I can change stream orientation using fwide()

by Andrei Voropaev <avorop@[EMAIL PROTECTED] > May 5, 2008 at 04:01 PM

On 2008-04-18, Terry <cong818@[EMAIL PROTECTED]
> wrote:
> I want to reopen stdout, so that I can change stream orientation on 
> stdout using fwide().
> Can this be done using only C library routines?

Not clear what you want. There's freopen function that allows to reopen
any stream, including stdout.

What is your situation exactly? You've already determined the
orientation and now want to change it, but don't know where to the
stdout is directed? On linux one can use fdopen to attach new stream to
a file descriptor. One would have to use dup and dup2 to preserve the
descriptor and then assign to stdout the stream returned from fdopen.
There might be some better way. Also, this way is not ****table.


-- 
Minds, like parachutes, function best when open
-- 
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
 -- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
 




 3 Posts in Topic:
How should I reopen stdout, so that I can change stream orientat
Terry <cong818@[EMAIL   2008-04-18 16:11:45 
Re: How should I reopen stdout, so that I can change stream orie
Andrei Voropaev <avoro  2008-05-05 16:01:26 
Re: How should I reopen stdout, so that I can change stream orie
Terry <cong818@[EMAIL   2008-05-22 16:52:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 0:43:57 CDT 2008.