Passing data to stdin using NSTask

Let's say I have a tool that at some point in its execution requests user input. For example, it may request a name and address. At another point, he may request a password (and rename the password).

Is it possible for NSTask and NSPipe to handle these things, that is, interact with command line tools?

+4
source share
1 answer

See setStandardInput: NSTask method. It allows you to set NSPipe or NSFileHandle as a standard task input before starting it. There are also similar methods for standard output and standard error .

+3
source

All Articles