How to make this pipe work in c++? -


i programming shell in c++. needs able pipe output 1 thing another. example, in linux, can pipe textfile more doing cat textfile | more.

my function pipe 1 thing declared this:

void pipeinput(string input, string output); 

i send "cat textfile" input, , "more" output.

in c++ examples show how make pipes, fopen() used. send input fopen()? have seen c++ examples of pipeing using dup2 , without suing dup2. what's dup2 used for? how know if need use or not?

take @ popen(3), way avoid execvp.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -