Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
solidco2 committed Mar 11, 2014
1 parent 1fb470b commit 800b531
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
node-dup2
=========
There isn't any way for us to redirect #1(fd) to any other file, before I born.

好吧,我是说,node里面没有dup2函数(当然你可以先关掉一个文件描述符,然后立即打开一个文件),我的出现就是用来提供dup2支持的。
Demo
require("node-dup2").invoke(oldfd, newfd);
此句会先关掉newfd文件描述符,而克隆oldfd的文件打开状态到newfd上。
失败时返回-1

0 comments on commit 800b531

Please sign in to comment.