![]() |
|
|
|
|
|||||||
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A program to trace execution of another program | jiten_hegde | High Level Programming | 2 | 05-22-2008 01:27 PM |
| C++ How to use pipe() & fork() with stdin and stdout to another program | vvaidyan | High Level Programming | 2 | 05-16-2008 04:30 PM |
| How to clear the content of a pipe (STDIN) after it is written to another program? | vvaidyan | High Level Programming | 10 | 05-15-2008 04:08 PM |
| How to write to stdin of another program (program A -> [stdin]program B) | vvaidyan | UNIX for Dummies Questions & Answers | 0 | 04-30-2008 09:36 AM |
| how can i write process_pool program? | hit | High Level Programming | 4 | 06-17-2002 12:36 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
How to write to stdin of another program (program A -> [stdin]program B)
Hi,
Program A: uses pipe() I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using: * child -> dup2(fd[1], STDOUT_FILENO); -> execl("/path/PROGRAM B", "PROGRAM B", NULL); * parent -> char line[100]; -> read(fd[0], line, 100); Question: --------- How to write to stdin of PROGRAM B from PROGRAM A? * should I use a different pipe? * how to I read stdin in PROGRAM B? using cin? Thanks in advance, Vivek |
| Forum Sponsor | ||
|
|
|
|||
|
It's against the:
Simple rules of the UNIX.COM forums: to double posts questions, continue here: How to write to stdin of another program (program A -> [stdin]program B) Thread close |
|||
| Google UNIX.COM |