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()
- Host: GitHub
- URL: https://github.com/iximiuz/popen2
- Owner: iximiuz
- Created: 2018-01-30T20:20:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-01T12:59:11.000Z (over 8 years ago)
- Last Synced: 2025-08-02T22:52:38.745Z (10 months ago)
- Topics: bidirectional, duplex-communication, pipe, popen, process
- Language: C
- Homepage: https://iximiuz.com/en/posts/how-to-on-processes/
- Size: 1000 Bytes
- Stars: 14
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
}
```