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 02-22-2004, 09:51 PM   #1
phil123
LQ Newbie
 
Registered: Jan 2004
Posts: 18

Rep: Reputation: 0
Unhappy how to redirecting the standard output in program


My program will do the pixel processing for output of other program.
So, I need redirect the output of the program from standard Output to my specified pipe
I do as this way in program:
...
dup2(fds[0],STDOUT_FILENO);
exelclp("runout","runout",NULL);
...
But it cannot work, I think execlp take place the my program, so dup2 cannot do its work in new process.

So, how to do?

if use the buffer, /dev/tty, how to do?
 
Old 02-22-2004, 11:12 PM   #2
natalinasmpf
Member
 
Registered: Dec 2003
Distribution: Slackware 9.1
Posts: 309

Rep: Reputation: 30
Just a suggestion, why don't you just write it to a file and have the pipe read it?

(also shouldn't this be in the programming forum )
 
Old 02-22-2004, 11:34 PM   #3
phil123
LQ Newbie
 
Registered: Jan 2004
Posts: 18

Original Poster
Rep: Reputation: 0
the output is realtime.

Yes, sounds good, but the output is realtime. if write to file first, seems not good.so i wish redirect to output to my specified pipe.
 
Old 02-23-2004, 12:02 AM   #4
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
y not write to the file stdout and have another program lsiting on that for the imformation?
 
  


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
redirecting output of compile to a file halfcan Linux - Hardware 1 02-05-2005 10:01 PM
Redirecting mplayer output driptray Linux - Software 1 10-12-2004 07:42 AM
redirecting xmms output durden2.0 Linux - Software 0 03-06-2004 07:29 PM
redirecting output to multiple outputs granny Linux - General 6 02-13-2004 07:18 AM
Capturing standard output from external program brianvdc Linux - Software 1 02-12-2003 03:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:25 PM.

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