Re: stdout redirect in xcode and not
Re: stdout redirect in xcode and not
- Subject: Re: stdout redirect in xcode and not
- From: Jason Foreman <email@hidden>
- Date: Mon, 22 Dec 2008 15:06:31 -0600
On Dec 22, 2008, at 2:39 PM, Wesley Smith wrote:
- (void)startRedirect
{
if (!oldWriteFunc)
{
oldWriteFunc = stream->_write;
stream->_write = stream == stdout ? stdoutwrite : stderrwrite;
}
}
I took a quick glance, and "stream" appears to be a FILE* in your
code. You shouldn't really modify a FILE structure this way--treat a
FILE* as though it were just an opaque pointer to something you know
nothing about. Messing with its insides is only going to lead you to
trouble.
If you want to redirect all stdout output to stderr, you can use
something like dup2(...) [`man 2 dup2`] to switch the fd of stdout to
point to stderr.
Jason
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden