Help with open, dup and dup2

S

seifyr

What sequence of calls to open, dup and/or dup2 do you perform in your
program in order to achieve the following effects?

$prog1>file 2>&1

and

$prog2 2>&1 > file

I understand which each line does, but I dont understand how to use dup
and dup2 to acheive this. I don't necessarily need code just an
understanding of how do accomplish this.
 
K

Keith Thompson

What sequence of calls to open, dup and/or dup2 do you perform in your
program in order to achieve the following effects?
[snip]

None. open, dup, and dup2 are not defined in standard C.
Try comp.unix.programmer.
 
I

Ian Collins

What sequence of calls to open, dup and/or dup2 do you perform in your
program in order to achieve the following effects?

$prog1>file 2>&1

and

$prog2 2>&1 > file

I understand which each line does, but I dont understand how to use dup
and dup2 to acheive this. I don't necessarily need code just an
understanding of how do accomplish this.
Pop along to comp.unix.programmer and post again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top