Re: Being notified of changes to a file
Re: Being notified of changes to a file
- Subject: Re: Being notified of changes to a file
- From: "Michael Ash" <email@hidden>
- Date: Mon, 21 Jul 2008 10:25:34 -0400
On Mon, Jul 21, 2008 at 3:56 AM, Yann Disser <email@hidden> 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 (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