From 5aea12b4c4e14b7add179a9943487a3f766ccaf8 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 27 Apr 2010 18:45:10 -0700 Subject: [PATCH] stdout should be writable only --- src/node.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/node.js b/src/node.js index 1ebed979e6f..e6875d83da6 100644 --- a/src/node.js +++ b/src/node.js @@ -139,6 +139,11 @@ process.__defineGetter__('stdout', function () { stdout = new fs.FileWriteStream(null, {fd: fd}); } else { stdout = new net.Stream(fd); + // FIXME Should probably have an option in net.Stream to create a stream from + // an existing fd which is writable only. But for now we'll just add + // this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stdout.readable = false; } return stdout;