execv()
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > execv()




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    execv()  
New


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 12:59 PM

How can I uses a pipe to get the output from a execv() and redirect it to a
parent process?
in ansi c if possible

Thank-you







[ Post a follow-up to this message ]



    Re: execv()  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 12:59 PM

In article <4121de0e$1_1@news.iprimus.com.au>, "New" <a@a.co> wrote:

> How can I uses a pipe to get the output from a execv() and redirect it to 
a
> parent process?
> in ansi c if possible

Create the pipe in the parent process, then fork.  In the child, use
dup2() to put the writing end of the pipe on stdout, then close the
pipe's descriptors.  In the parent, close the writing end of the pipe
and read from the reading end.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Re: execv()  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 12:59 PM

New wrote:
> How can I uses a pipe to get the output from a execv() and redirect it to 
a
> parent process?
> in ansi c if possible
>
> Thank-you
>
>

Give http://www.faqs.org/faqs/unix-faq/programmer/faq/ a read.

-- ced

--
Chuck Dillon
Senior Software Engineer
NimbleGen Systems Inc.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:09 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register