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: Jens Alfke <email@hidden>
- Date: Sun, 20 Jul 2008 15:38:25 -0700
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 printing single lines on standard
out containing percentages (e.g. "15%"). How can I update my
application continuously depending on that progress? (for progress
bars and other output)
Your subject implies you're writing to a file; don't do that. The Ruby
script should write to stdout, and you app should hook up an NSPipe to
the NSTask to read its output directly. (This can be a bit tricky, but
there's Apple sample code that shows how to do it.)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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