Results 1 to 2 of 2
Hi everyone, I wonder if someone can help me:
In order to implement a pipe, I redirected stdin into the pipe...
close(0);
dup(m[0]);
...
My problem is, after i use ...
- 05-07-2007 #1Just Joined!
- Join Date
- Apr 2007
- Posts
- 6
help with input/output redirection
Hi everyone, I wonder if someone can help me:
In order to implement a pipe, I redirected stdin into the pipe...
close(0);
dup(m[0]);
...
My problem is, after i use the pipe, I want to continue the execution, using stdin normally (reading from the keyboard just like before).
But, even if close the pipe, I can not recover stdin to 0...
How can I do this? please post the line of code that recovers it...
Thank you very much
HW
- 05-07-2007 #2Linux Newbie
- Join Date
- Sep 2005
- Location
- CZ
- Posts
- 164
If you do a
Do you try to do something likeCode:close(0)
again?Code:open(0)
Last edited by Lost_scrib; 05-07-2007 at 03:48 PM. Reason: Added something like to not get confused...


Reply With Quote