Page 1 of 1

Problem reading from stdout

Posted: Sat May 04, 2013 12:18 am
by dkelly
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?

Problem reading from stdout

Posted: Mon May 06, 2013 3:09 pm
by carineb
Hi Dwight,



It is hard to say why it did not work, we think it depends on the particular application. Actually, there are number of functions for stdout functionality:



- readStdout

- canReadLineStdout / readLineStdout

- stdout property



We think one of them should work. Is it possible to check if something was sent to stdout by checking the process' stdout property when the app is finished?



If this is still reproducible and you want us to take a look at it, do not hesitate to send the script and app to us!



Kind regards,

Carine