• 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: Lindsey Spratt <email@hidden>
  • Date: Tue, 5 Nov 2002 18:37:47 -0600

On Tuesday, November 5, 2002, "Jeff Schindler"
<email@hidden> wrote:
> | 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.

I don't know of an easy way. I set up a general I/O redirection in the
Cocoa wrapper for gprolog that I'm building. To do this I create my own
FILE structure 'windowIO', then set stdout, stderr, and stdin equal to
'&windowIO'.

The windowIO structure has function pointers in it for close, read,
write, seek and something else I'm forgetting. I wrote my own functions
for these. My read and write functions were the really interesting
part. You would only need a write function (which is easier than the
read function because you don't need to handle blocking). The write
function sends a message using the objc_msgSend procedure to an ObjC
object that can get to the NSTextView for your error log window.

Simple. :-)

Lindsey Spratt
http://homepage.mac.com/lspratt
_______________________________________________
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.

  • Prev by Date: Re: Good ol' modal dialogs
  • Next by Date: Re: cocoa-dev digest, Vol 2 #1485 - 16 msgs
  • Previous by thread: Re: redirect stderr
  • Next by thread: Good ol' modal dialogs
  • Index(es):
    • Date
    • Thread