Problem reading from stdout

Post Reply
dkelly
TOP CONTRIBUTOR
Posts: 628
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Problem reading from stdout

Post 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?
carineb
Member
Posts: 31
Joined: Wed Oct 20, 2010 2:39 pm

Problem reading from stdout

Post 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
Post Reply