• 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
NSFileHandleReadCompletionNotification and/or NSTaskDidTerminateNotification?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSFileHandleReadCompletionNotification and/or NSTaskDidTerminateNotification?


  • Subject: NSFileHandleReadCompletionNotification and/or NSTaskDidTerminateNotification?
  • From: Herman Steve <email@hidden>
  • Date: Thu, 15 Jun 2006 10:59:45 -0500

My app is creating and launching an NSTask. I'm registering for NSTaskDidTerminateNotification as well as NSFileHandleReadCompletionNotification. The task may or may not generate output.

Currently I'm not reliably receiving the NSTaskDidTerminateNotification... and I discovered that when this is occurring I seem to be getting the NSFileHandleReadCompletionNotification instead with zero data. I was thinking that zero data possibly meant that there simply wasn't any data _yet_ so I was calling "readInBackgroundAndNotify" again with the assumption that if the task had truly terminated I would eventually get the termination notification. Instead this seems to be leading to an endless stream of NSFileHandleReadCompletionNotifications... all with zero data.

So I guess my questions are:

If I receive an NSFileHandleReadCompletionNotification and there is no data is that an indication that the task is completed and that I should no longer call "readInBackgroundAndNotify"?

When registering for both NSFileHandleReadCompletionNotification _and_ NSTaskDidTerminateNotification is it basically a toss up as to which notification you'll receive first for a task that produces no output? (This would perhaps explain why sometimes I'm receiving the termination notification and sometimes not)

Thanks,
Steve

--

Steve Herman
Macintosh Software Development and Support
Lockheed Martin Information Technology
102 Research Blvd, Building 2
Madison, AL 35758             (voice) 256 319-2869
mailto:email@hidden         (fax) 256 319-2984

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSFileHandleReadCompletionNotification and/or NSTaskDidTerminateNotification?
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: Re: Disallow edit for rows in NSOutlineView
  • Next by Date: text fields in drawers don't un-highlight in background
  • Previous by thread: Re: Application does not run on double click
  • Next by thread: Re: NSFileHandleReadCompletionNotification and/or NSTaskDidTerminateNotification?
  • Index(es):
    • Date
    • Thread