I use psuedo-code to express what I want to do:
FILE* fd = popen("/bin/cat", ...);
Write some data to the stdin of `/bin/cat` using fd;
Read all data from the stdout of `/bin/cat` using fd;
Is it possible?
popen() can only read from the new process. If you need to read and write,
pipe()
.fork()
dup2()
exec
family functions