LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-20-2011, 09:04 AM   #1
HarryBoy
Member
 
Registered: Apr 2008
Distribution: MontaVista Linux Version 4.0.1, Professional Edition
Posts: 215

Rep: Reputation: 16
reading stdout question.


Hi,

I have a three binarys, called mainBinary, databaseBinary and otherBinary.

mainBinary calls databaseBinary at startup and reads data from its stdout.

mainBinary also launches otherBinary as a child process. otherBinary sometimes needs to call databaseBinary and this information needs to be sent to mainBinary as well. At present this is send via otherBinary back up to mainBinary via sockets.

Is it possible that everytime databaseBinary is called (from any process) that its stdout is read automatically by mainBinary????

I hope you understand this.

basically I want mainBinary to always read the stdout of databaseBinary no matter what process calls it??

Thanks
 
Old 01-20-2011, 09:21 AM   #2
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
What about routing the stdout of databaseBinary always to a fifo device? And the mainBinary is reading this fifo device.
 
Old 01-20-2011, 11:07 AM   #3
HarryBoy
Member
 
Registered: Apr 2008
Distribution: MontaVista Linux Version 4.0.1, Professional Edition
Posts: 215

Original Poster
Rep: Reputation: 16
There can be several mainBinaries running at once, does this make a difference with your suggestion??
 
Old 01-20-2011, 11:46 AM   #4
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
No. But you will need to include some notifier of the source, as the messages will arrive interleaved then.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redirect standard stdout to multi stdout ( Bash )? john.daker Programming 4 11-03-2008 11:20 PM
redirecting stdout to /dev/null and stderr to stdout? Thinking Programming 1 05-18-2006 02:36 AM
reading from stdout nodger Programming 2 02-24-2005 07:49 AM
Reading Stdout into a Flatfile omarbohsali Programming 2 01-16-2005 07:24 AM
shell short question(stdout, stderr) blackzone Programming 4 11-11-2004 09:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:53 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
Open Source Consulting | Domain Registration