Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UVStream, bugfix: make fd of stdio work in blocking mode. (#623)
- Loading branch information
1 parent
1c1930f
commit b0c58bb
Showing
4 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @see https://github.com/fibjs/fibjs/issues/620 | ||
* | ||
* you can access process.std, and `console.readLine()` normally. | ||
*/ | ||
process.stdin | ||
process.exitCode = 1; | ||
console.log(console.readLine()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @see https://github.com/fibjs/fibjs/issues/622 | ||
* | ||
* you can use stdio as you thought based on libuv | ||
*/ | ||
process.stdout | ||
const len = parseInt(process.env.COUNT_LEN); | ||
Array.apply(null, { length: len }).fill(undefined).forEach((_, idx) => { | ||
console.log(`${idx + 1}`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters