• 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 21:01:47 +0200


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

The problem is probably that you don't empty the buffer in the queue between the processes.
Not sure I follow. Isn't the newly allocated pipe empty, and filled up by the launchedTaskWithLaunchPath?

Yes, it will fill up - but it has a max size. You can find a reference to that in the conceptual documentation of NSTask.


I took a look which resulted in the following rewrite:

Unfortunately you also missed the important point of the sample code. What you want is to register for the file handle notifications, so that you can empty the queue piece by piece, asynchronously, as the data arrives.


But I'm still seeing the same thing. All the data appears in the run log but "taskData = [[[testTask standardOutput] fileHandleForReading] availableData]" is empty. It executes OK but there's nothing in it.

Where does the data in the run log come from? Your NSLog statement? I thought you said that you hanged while trying to read from the task? If you're not, then you might have some other problem than the one I'm trying to fix... ;-)


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

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>)

  • Prev by Date: Re: Linking libxml and libxslt
  • Next by Date: Re: Reading data from an NSTask
  • Previous by thread: Re: Reading data from an NSTask
  • Next by thread: Re: Reading data from an NSTask
  • Index(es):
    • Date
    • Thread