LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 08-19-2004, 12:32 PM   #1
vtaminh
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, 01:57 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,156

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
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, 02:05 PM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
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
??????
 
  


Reply


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
redirect AND print stdout samel_tvom Programming 12 10-07-2012 06:37 PM
Multiple threads vs Multiple processes deveraux83 Programming 1 05-11-2005 11:22 AM
How to output a C stream into a binary file readable via Fortran I/O? zero79 Programming 8 02-07-2005 09:51 PM
redirect stdin/stdout of running process xtravar Linux - Software 3 03-06-2004 08:54 PM
TCSH: redirect stdout and stderr seperately ugenn Linux - General 2 06-06-2002 01:07 PM


All times are GMT -5. The time now is 11:35 AM.

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