473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Pipe process stdout to another process stdin?

SDS
Anyone know of a slick way to pipe the standard output of Process A
into the standard input of Process B (and then capture the standard
output of Process B)?

I've got it working with 2 Process objects, a thread that pushes A's
stdout into B's stdin via a looping structure, and a loop on the thread
where the processes were started from that captures the stdout from B.
I was hoping there was a cleaner way of doing this considering you can
do it all in one shot via the command line.

Ideas?

Thx in advance. =)

Nov 17 '05 #1
2 6176
hi,

No AFAIK, that is a pretty simple way though. why you want to change it?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"SDS" <ss*******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Anyone know of a slick way to pipe the standard output of Process A
into the standard input of Process B (and then capture the standard
output of Process B)?

I've got it working with 2 Process objects, a thread that pushes A's
stdout into B's stdin via a looping structure, and a loop on the thread
where the processes were started from that captures the stdout from B.
I was hoping there was a cleaner way of doing this considering you can
do it all in one shot via the command line.

Ideas?

Thx in advance. =)

Nov 17 '05 #2
SDS
The only reason I'd want to change it is because I'm always looking for
better ways to do things. If there was a more direct solution, like
being able to connect the streams, it would take some of the
complication out of my current solution like, for example, the thread
management.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bernhard Kuemel | last post by:
Hi! I want to read/write commands and program input to/from /bin/bash several times before I close the stdin pipe. However, reading from cat hangs unless I first close the stdin pipe. <?php...
2
by: Hoegje | last post by:
I am writing a C++ program, which should create a sub- process to start a telnet session to another server. Then it should login to that server (on the telnet login) and execute one or more...
5
by: richard | last post by:
I have a simple test to pass information from a client to a server using named pipe. what I really want is: when I type a line on the client, the server will output the line immediately. but to my...
3
by: PC | last post by:
Is it possible to create pipe()s (stdin/stdout) for a child process and forking a shell with execl() and controlling the shell's stdin/stdout from the parent with select()? Heres a little snippet...
7
by: Greg | last post by:
I am trying to implement the UNIX pipe command using C but with the "->" operator. Everything works fine with 1 pipe, but when I try to use 2 or more, it hangs up when reading the pipe_in...
4
by: bill | last post by:
I am confused by the behavior of the following code. The function copy() takes two FILE *'s and copies the data from one to the other. In the main routine, I create a pipe and copy stdin to the...
11
by: 7stud | last post by:
Hi, Can someone explain what a broken pipe is? The following produces a broken pipe error: ---------- import subprocess as sub p = sub.Popen(, stdin=sub.PIPE, stdout=sub.PIPE)
8
by: Jim B. Wilson | last post by:
I have the mother (of all) application(s, written in C++) that occasionally outsources certain tasks to a child Python script. The mother fork/execs (or equivalent) the child and then begins...
1
by: Jean-Paul Calderone | last post by:
On Mon, 12 May 2008 17:35:44 -0700 (PDT), schickb <schickb@gmail.comwrote: Alas, you haven't actually closed src's standard input. Though you did close src.stdin, you didn't close the copy of it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.