On Mon, Jul 21, 2008 at 3:56 AM, Yann Disser <[EMAIL PROTECTED]> wrote:
> Thanks for your reply.
>
> Hmm, the subject is rather ill chosen. (I started to write the mail and then
> looked a little more into NSPipe before finishing it) My script actually
> writes to stdout.
>
> What I am trying to figure out, is how to respond right away to every single
> line that is written on stdout without waiting for the process to be
> finished.

If the problem is that you get big chunks all at once instead of line
by line, then the problem is in your ruby program, not your Cocoa
program. You need to flush stdout after you write each line, otherwise
the system will buffer the output for better performance, which will
lead to chunking. There is nothing special to do on the Cocoa side
besides sign up for notifications or block on -availableData in a
thread. But you won't get chunks smaller than what the other side is
writing.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to