Re: Wrapping an Interactive Unix Executable
Re: Wrapping an Interactive Unix Executable
- Subject: Re: Wrapping an Interactive Unix Executable
- From: Steven Palm <email@hidden>
- Date: Thu, 16 Dec 2004 15:47:08 -0600
On Dec 16, 2004, at 10:59 AM, Kevin Patfield wrote:
NSTask and NSPipe are exactly what you need. Each instance of NSTask
can only be run once but you just make a new one for each user input.
When the task is complete you read the data out of the pipe and
release both objects. When the user makes a new request, repeat the
process.
I think Jérôme Laurens was closer for this task... If the executable
stays running and reads something on it's standard input, gives you
results on it's standard output, and then waits for more input... You
can easily use NSTask/NSPipes to launch it once and cycle.... Feed it
data, read the output, feed it data, read the output, etc... When you
are ready to quit you either send it whatever command it uses to quit
or just terminate the NSTask.
Has worked great here for several projects I've done.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden