mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-08-06 13:26:29 -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:
|
More detailed way:
|
||||||
```cpp
|
```cpp
|
||||||
auto p = Popen({"ls", "-l"});
|
auto p = Popen({"ls", "-l"}, output{PIPE});
|
||||||
auto obuf = p.communicate().first;
|
auto obuf = p.communicate().first;
|
||||||
std::cout << "Data : " << obuf.buf.data() << std::endl;
|
std::cout << "Data : " << obuf.buf.data() << std::endl;
|
||||||
std::cout << "Data len: " << obuf.length << 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;
|
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() {
|
int main() {
|
||||||
|
/*
|
||||||
test_exename();
|
test_exename();
|
||||||
test_input();
|
test_input();
|
||||||
test_piping();
|
test_piping();
|
||||||
@ -72,5 +81,7 @@ int main() {
|
|||||||
test_shell();
|
test_shell();
|
||||||
test_sleep();
|
test_sleep();
|
||||||
test_read_all();
|
test_read_all();
|
||||||
|
*/
|
||||||
|
test_simple_cmd();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user