Created
January 7, 2010 08:29
-
-
Save ry/271086 to your computer and use it in GitHub Desktop.
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
bpt-dmz 0 ~/node/stdin_issue > cat sub.js | |
var sys = require("../lib/sys"); | |
process.stdio.open(); | |
process.stdio.addListener("data", function (data) { | |
sys.puts("child: " + data); | |
}); | |
bpt-dmz 0 ~/node/stdin_issue > cat test.js | |
var sys = require("../lib/sys"); | |
var path = require('path'); | |
var sub = path.join(path.dirname(__filename), 'sub.js'); | |
sys.puts(sub); | |
var child = process.createChildProcess("../node", [sub]); | |
child.addListener("error", function (data){ | |
sys.puts("parent stderr: " + data); | |
}); | |
child.addListener("output", function (data){ | |
sys.puts("parent: " + data); | |
}); | |
setTimeout(function () { | |
child.write('test\r\n'); | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment