An open API service indexing awesome lists of open source software.

https://github.com/iximiuz/popen2

popen2() - bidirectional popen()
https://github.com/iximiuz/popen2

bidirectional duplex-communication pipe popen process

Last synced: 10 months ago
JSON representation

popen2() - bidirectional popen()

Awesome Lists containing this project

README

          

# popen2 - duplex popen()

Like [`popen()`](http://man7.org/linux/man-pages/man3/popen.3.html) but returns
both child's `stdin` and `stdout`.

## Usage
```
#include"popen2.h"
#include

int main() {
files_t *fp = popen2("cat");
fputs("foobar\n", fp->in);
fflush(fp->in);

char buf[64] = {};
fgets(buf, 64, fp->out);
printf("%s", buf);

pclose2(fp);
}
```