mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-08-05 04:46:21 -04:00
readme minor missing content #22
This commit is contained in:
parent
d74481c564
commit
e6cb89cb6e
@ -48,7 +48,7 @@ std::cout << "Data len: " << obuf.length << std::endl;
|
||||
|
||||
More detailed way:
|
||||
```cpp
|
||||
auto p = Popen({"ls", "-l"});
|
||||
auto p = Popen({"ls", "-l"}, output{PIPE});
|
||||
auto obuf = p.communicate().first;
|
||||
std::cout << "Data : " << obuf.buf.data() << std::endl;
|
||||
std::cout << "Data len: " << obuf.length << std::endl;
|
||||
|
@ -64,7 +64,16 @@ void test_read_all()
|
||||
std::cout<<"read_all() succeeded"<<std::endl;
|
||||
}
|
||||
|
||||
void test_simple_cmd()
|
||||
{
|
||||
auto p = Popen({"ls", "-l"}, output{PIPE});
|
||||
auto obuf = p.communicate().first;
|
||||
std::cout << "Data : " << obuf.buf.data() << std::endl;
|
||||
std::cout << "Data len: " << obuf.length << std::endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
/*
|
||||
test_exename();
|
||||
test_input();
|
||||
test_piping();
|
||||
@ -72,5 +81,7 @@ int main() {
|
||||
test_shell();
|
||||
test_sleep();
|
||||
test_read_all();
|
||||
*/
|
||||
test_simple_cmd();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user