Re: redirect stderr
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.