阅读背景:

关闭它们后重新打开stdout和stdin文件描述符

来源:互联网 

I'm writing a function, which, given an argument, will either redirect the stdout to a file or read the stdin from a file. To do this I close the file descriptor associated with the stdout or stdin, so that when I open the file it opens under the descriptor that I just closed. This works, but the problem is that once this is done, I need to restore the stdout and stdin to what they should really be.I'm writing a function, which, given an argumen




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: