Re: Being notified of changes to a file

2008-07-22 Thread Yann Disser
Ok, thank you all guys! I got it working somehow ^^ Here is my code (if anyone is interested - I am probably doing a lot of crazy things, please correct me): #import @interface Observer : NSObject {} - (void) outputStuff:(NSNotification*)aNotification; @end @implementation Observer - (void

Re: Being notified of changes to a file

2008-07-21 Thread Finlay Dobbie
On Mon, Jul 21, 2008 at 8:56 AM, Yann Disser <[EMAIL PROTECTED]> wrote: > 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. There are many examples of this. See

Re: Being notified of changes to a file

2008-07-21 Thread Dmitri Goutnik
On Jul 20, 2008, at 8:37 PM, Yann Disser wrote: Hi everyone. I am trying to execute a ruby script from within a Cocoa application. I want to use NSTask (any better ideas?). My scripts outputs its progress by printing single lines on standard out containing percentages (e.g. "15%"). How ca

Re: Being notified of changes to a file

2008-07-21 Thread Vitaly Ovchinnikov
I don't think that you can capture stdout. You need to create a pipe and redirect your script's output there. And then read from that pipe, parse and update your progress indicator. A good starting point is here: http://www.cocoadev.com/index.pl?NSPipe On Mon, Jul 21, 2008 at 11:56 AM, Yann Disser

Re: Being notified of changes to a file

2008-07-21 Thread Michael Ash
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 fi

Re: Being notified of changes to a file

2008-07-21 Thread Yann Disser
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

Re: Being notified of changes to a file

2008-07-20 Thread Jens Alfke
On 20 Jul '08, at 9:37 AM, Yann Disser wrote: I am trying to execute a ruby script from within a Cocoa application. I want to use NSTask (any better ideas?). You can use the Ruby C API to run Ruby inside your process, but that's definitely more work. My scripts outputs its progress by pr

Being notified of changes to a file

2008-07-20 Thread Yann Disser
Hi everyone. I am trying to execute a ruby script from within a Cocoa application. I want to use NSTask (any better ideas?). My scripts outputs its progress by printing single lines on standard out containing percentages (e.g. "15%"). How can I update my application continuously depending