Skip navigation.
 
mlRe: Wrapping an Interactive Unix Executable
FROM : Steven Palm
DATE : Thu Dec 16 22:47:08 2004

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.

Related mailsAuthorDate
mlWrapping an Interactive Unix Executable Erik André Mendoza Dec 16, 09:57
mlRe: Wrapping an Interactive Unix Executable R.Claeson Dec 16, 10:02
mlRe: Wrapping an Interactive Unix Executable Jérôme Laurens Dec 16, 10:50
mlRe: Wrapping an Interactive Unix Executable Kevin Patfield Dec 16, 17:59
mlRe: Wrapping an Interactive Unix Executable Steven Palm Dec 16, 22:47