mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-09-06 22:00:29 -04:00
16 lines
315 B
C++
16 lines
315 B
C++
#include <iostream>
|
|
#include "../subprocess.hpp"
|
|
|
|
using namespace subprocess;
|
|
|
|
int main() {
|
|
auto p = Popen({"cat", "-"},
|
|
input{PIPE},
|
|
output{PIPE});
|
|
const char* msg = "through stdin to stdout";
|
|
auto res = p.communicate(msg, strlen(msg)).first;
|
|
std::cout << res.buf.data() << std::endl;
|
|
|
|
return 0;
|
|
}
|