• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: stdout redirect in xcode and not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: stdout redirect in xcode and not
      • From: "Wesley Smith" <email@hidden>
References: 
 >stdout redirect in xcode and not (From: "Wesley Smith" <email@hidden>)
 >Re: stdout redirect in xcode and not (From: Tommy Nordgren <email@hidden>)
 >Re: stdout redirect in xcode and not (From: "Wesley Smith" <email@hidden>)

  • Prev by Date: Re: stdout redirect in xcode and not
  • Next by Date: Re: stdout redirect in xcode and not
  • Previous by thread: Re: stdout redirect in xcode and not
  • Next by thread: Re: stdout redirect in xcode and not
  • Index(es):
    • Date
    • Thread