I am attempting to help a PhD student in his research by supplying him with a fortran EXE (+ SALFLIBC.DLL) - 32 bit - which he can call from Java. The routine will read from existing files and write results to a new output file. He can successfully call other 16 and 32 bit EXE's (not fortran based). However when attempting to run even the simple program below (reading from an existing file numbers 1 to 5 and writing the same to a new file) from Java, whilst no error message occur and the Java code reports the program has run OK no output file linktest4 is produced!?
dimension k(5 )
1 format(i4) open(8,file='linktest.txt') do 20 j = 1,5 read(8,1)k(j) 20 continue close(8) open(9,file='linktest4.txt') do 30 l=1,5 write(9,1) k(l) 30 continue close(9)
I appreciate that this is presumably a Java issue - or is there something associated with the fortran that makes calls to run a Fortran based EXE different. Any pointers would be gratefully received
Bill
package runexe;
public class Main { public static void main(String[] args) { try { Process proc = Runtime.getRuntime().exec('C:\\cargont\\runcargo.exe'); proc.waitFor(); System.out.println('Execution complete'); }catch(Exception e) { e.printStackTrace(); } } }