• 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: redirect stderr
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: redirect stderr


  • Subject: Re: redirect stderr
  • From: "Jeff Schindler" <email@hidden>
  • Date: Tue, 12 Nov 2002 15:23:44 -0500

Having a nice little conversation with myself here, but...

After digging into this a little further, it seems that you can get the
stderr NSFileHandle from the NSFileHandle class. It seems that one should
just be able to add oneself as an observer of
NSFileHandleReadCompletionNotification and then send the stderr filehandle
off listening via readInBackgroundAndNotify, ie:

NSFileHandle *fh = [NSFileHandle fileHandleWithStandardError];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(getData:)
name: NSFileHandleReadCompletionNotification
object: fh];
[fh readInBackgroundAndNotify];

I've tried this, but my notification proc never gets called. Am I missing
something here? Anyone?

Thanks,
Jeff
----- Original Message -----
From: "Jeff Schindler" <email@hidden>
To: "Jeff Schindler" <email@hidden>;
<email@hidden>
Sent: Tuesday, November 05, 2002 12:35 PM
Subject: Re: redirect stderr


| Never mind - should've checked the archives first.
|
| Looks like NSTask is the answer.
|
| Jeff
| ----- Original Message -----
| From: "Jeff Schindler" <email@hidden>
| To: <email@hidden>
| Sent: Tuesday, November 05, 2002 10:20 AM
| Subject: redirect stderr
|
|
| | Hello,
| |
| | Is there any easy (or hard) way to redirect stderr, or more specifically
| the
| | output from NSLog? We'd like to output it to a window in our
application.
| |
| | Thanks,
| | Jeff
| | _______________________________________________
| | cocoa-dev mailing list | email@hidden
| | Help/Unsubscribe/Archives:
| http://www.lists.apple.com/mailman/listinfo/cocoa-dev
| | Do not post admin requests to the list. They will be ignored.
| |
|
|
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >redirect stderr (From: "Jeff Schindler" <email@hidden>)
 >Re: redirect stderr (From: "Jeff Schindler" <email@hidden>)

  • Prev by Date: Re: [Bug?] Text rendering under Cocoa
  • Next by Date: App exits on alloc
  • Previous by thread: Re: redirect stderr
  • Next by thread: Re: redirect stderr
  • Index(es):
    • Date
    • Thread