Processes
This chapter has recipes that show how to run external programs, how to interact with them, and how to terminate a process gracefully. There are some key points to keep in mind when dealing with external processes:
- When you start an external process, it runs concurrently with your program.
- If you need to communicate with a child process, you have to use an interprocess communication mechanism, such as pipes.
- When you run a child process, its standard input and standard output streams appear to the parent process as independent concurrent streams. You cannot rely on the ordering of data you receive from these streams.
This section covers the following main recipes:
- Running external programs
- Passing arguments to a process
- Processing output from a child process using a pipe
- Providing input to a child process
- Changing environment variables of a child process
- Graceful termination using signals