eidheim / tiny-process-library

A small platform independent library making it simple to create and stop new processes in C++, as well as writing to stdin and reading from stdout and stderr of a new process
MIT License
338 stars 73 forks source link

how can i set enviroment var for process? #19

Closed sixleaves closed 7 years ago

sixleaves commented 7 years ago

how can i set enviroment var for process?how can i set enviroment var for process?

eidheim commented 7 years ago

Typically one would write something like Process process("TEST=1 env", ...). You can replace env with your program. The child process also gets the enviroment of the parent process, so you can use setenv as well before starting the child process.