Using the NSTask Class
The NSTask class can be used to launch another process. In conjunction with other Cocoa classes, such as NSPipe, it can also set up communications between your program and the launched NSTask. To understand what facilities are available, it is instructive to first consider some of the ways you can communicate with another process.
Each process can take input from its environment variables, command-line arguments, files, and stdin (standard input). It can send output to a file, stdout (standard output), or stderr (standard error). Each process also has an integer return value, which is normally set to zero when a process exits successfully. Processes can also open up Unix pipes and sockets to communicate with each other. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access