Re: NSTask and NSPipe has buffering issues?
Re: NSTask and NSPipe has buffering issues?
- Subject: Re: NSTask and NSPipe has buffering issues?
- From: "Mr. Gecko" <email@hidden>
- Date: Tue, 31 Jul 2012 18:28:53 -0500
What do you recommend after the task finishes? I have tried [[outPipe fileHandleForReading] readDataToEndOfFile] after the task finishes and it doesn't seem to improve. Can you maybe give me an example of how to do this right?
On Jul 31, 2012, at 6:01 PM, Wim Lewis <email@hidden> wrote:
> I haven't looked at the code you posted, but is it possible that you're reading from the NSPipe in such a way that you're mixing up the "end-of-file" indication with the "no more data is available right now, but may arrive later" indication? That's a common reason for this kind of problem.
>
> IIRC, NSPipe simply wraps a Unix pipe, which will hold unread data even after the writer closes its end of the pipe (that is, the writer can write some data and exit before the reader reads anything, and the reader will still get all the data followed by EOF).
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden