Problem reading from stdout
Posted: Sat May 04, 2013 12:18 am
Maybe because it's late on a Friday but I can't get my script to read anything from stdout.
var myprocess = new Process("cat");
myprocess.start();
myprocess.writeToStdin("Hello World!");
var output;
do {
output = myprocess.readStdout();
if (output.length) {
job.log(1, "output was " + output);
}
} while (output.length);
When I run this code it always fails to generate output. I've replaced my app with standard Unix/OSX 'cat' program. Fails for this and other applications. Why?
var myprocess = new Process("cat");
myprocess.start();
myprocess.writeToStdin("Hello World!");
var output;
do {
output = myprocess.readStdout();
if (output.length) {
job.log(1, "output was " + output);
}
} while (output.length);
When I run this code it always fails to generate output. I've replaced my app with standard Unix/OSX 'cat' program. Fails for this and other applications. Why?