Re: Executing diff.exe with System call
Hakan wrote:
I want to call the Windows version of the GNUDiff utilities from a Java
application with a call to the Runtime routines. I downloaded and
installed it and wrote the code that seemed to be right. This is the
equivalence of what I have for a call trying to compare two files
redirecting outout to a file.
String[] args=new String[5];
args[0]=C:\HL\GnuWin32\bin\diff.exe;
args[1]=C:\HL\eclipse\workspace\JIAS\getdeck.txt; (file 1)
args[2]=C:\HL\eclipse\workspace\JIAS\ddeck.txt; (file 2)
args[3]=">";
args[4]="diffres.txt" (output file)
try
{
Runtime.getRuntime().exec(args):
}
catch(IOException e)
{
}
Yet nothing happens. It compiles and runs, but the output file is
nowhere to be found. Where have I gone wrong?
Second by not looking in the right directory for "diffres.txt". It will go in
the classpath because you haven't told it otherwise, probably in the same
directory as the .class file as the class you claim "compiles and runs".
--
Lew