• 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: Reading data from an NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading data from an NSTask


  • Subject: Re: Reading data from an NSTask
  • From: j o a r <email@hidden>
  • Date: Mon, 4 Jul 2005 22:47:13 +0200


On 4 jul 2005, at 22.33, Ken Tozier wrote:

I just re-read the NSTask documentation and I still don't get the impression that NSTasks can only be run asynchronously. One of it's methods "waitUntilExit" states:

"Suspends your program until the receiver is finished. This method first checks to see if the receiver is still running using isRunning. Then it polls the current run loop using NSDefaultRunLoopMode until the task completes."

Which I'm interpreting as a synchronous way to use NSTasks. Correct?

Right, and if you DON'T set up the output pipes, it will probably work just fine - try it out!


I may have to go the asynchronous route, but it seems like I'm just making a minor error here. It should work. Any glaring errors jump out at anyone?

Just the one I've mentioned from the start:

"Your program can communicate with the task by attaching one or more NSPipe instances to the task’s standard input, output, or error devices before launching the task. A pipe is a one-way communications channel between related processes; one process writes data while the other process reads that data. The data that passes through the pipe is buffered; the size of the buffer is determined by the underlying operating system."

Once you try to funnel the output of your task into the pipe, you're subject to the limitations of that pipe.

j o a r



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Reading data from an NSTask
      • From: Ken Tozier <email@hidden>
References: 
 >Reading data from an NSTask (From: Ken Tozier <email@hidden>)
 >Re: Reading data from an NSTask (From: j o a r <email@hidden>)
 >Re: Reading data from an NSTask (From: Ken Tozier <email@hidden>)
 >Re: Reading data from an NSTask (From: j o a r <email@hidden>)

  • Prev by Date: Fwd: Reading data from an NSTask
  • Next by Date: RE: iMovie-like sliding ready for drag
  • Previous by thread: Re: Reading data from an NSTask
  • Next by thread: Re: Reading data from an NSTask
  • Index(es):
    • Date
    • Thread