problems with getOutputStream of Runtime.exec
Hi, I have a problem with the method getOutputStream() of the Process generated by Runtime.exec
I need java to execute the command
Bioinfo/ncoils/ncoils -f < template.fasta
My code is:
Process p = Runtime.getRuntime().exec("Bioinfo/ncoils/ncoils -f");
BufferedReader in = new BufferedReader(new FileReader("template.fasta"));
String line;
OutputStream os = p.getOutputStream();
PrintWriter w1 = new PrintWriter(os);
while( (line=in.readLine()) != null) w1.println(line);
in.close();
os.close();
w1.close();
p.waitFor()
But the program ncoils actsas if it has not received any input .....
Could you help me find what's wrong?
Thanks a lot! Francesco

