Re: Reading data from an NSTask
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