Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-19-2004, 11:32 AM   #1
LQ Newbie
Registered: Jul 2004
Location: Providence, RI
Distribution: Mandrake 10.0 [Yes, i know]
Posts: 3

Rep: Reputation: 0
how to redirect stdout [binary stream] to multiple processes

I have a program writing to stdout a binary stream of data (which it is extracting from a device). I want to send that stream to two independent processes, and I don't know how. How can I do this?
Old 08-19-2004, 12:57 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Assuming this is a program that you're writing, simply call dup on STDOUT_FILENO as many times as you need and pipe the reulting file descriptor(s) to whatever programs you want. If it's not a program you're writing, perhaps send the data to a socket and have all your listners reading from that socket (I'm not entirely sure if this will work).
Old 08-19-2004, 01:05 PM   #3
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
i'm just thinking out loud here !
haven't tried or tested any of this
seem like you could use named pipes (FIFOs)

ok say you
FILE* stream = popen ("myOtherProccess" , "w");
then you make another program myOtherProccess
so all it does is takes in the data stream
and writes in out to two different named pipes
then your two other procceses can read from the FIFOs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
TCSH: redirect stdout and stderr seperately ugenn Linux - General 3 02-07-2016 03:23 PM
redirect AND print stdout samel_tvom Programming 12 10-07-2012 05:37 PM
Multiple threads vs Multiple processes deveraux83 Programming 1 05-11-2005 10:22 AM
How to output a C stream into a binary file readable via Fortran I/O? zero79 Programming 8 02-07-2005 08:51 PM
redirect stdin/stdout of running process xtravar Linux - Software 3 03-06-2004 07:54 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration