Executing a win32 console application from within the VM

Hi,

I'm trying to execute a relatively new Fortran executable that was compiled as a win32 console application.

What I'm doing is:

Runtime run;

Process proc = run.exec(pathToExecutable + parameters, null, ExecutePath)

proc.waitFor();

The log from the Fortran executable indicates that it managed to start but it seems to get stuck before printing anything to the console (even though log output from the Fortran executable to a file is fine) and the task manager confirms the process starts but just doesn't do anything. Ordinarily when executing the program under WinXP a console opens up to displaying computation progress.

So I am thinking that the calls to printing to the screen in Fortran are blocking and since no console is available to print to the process gets stuck and doesn't complete (although I have no evidence for this). In fact any attempts I made at opening a console from within the VM (via the cmd.exe in system32) failed.

As you may have noticed this is my first attempt at running another executable from the VM so I hope I am unaware of something that can solve my problem. If you know about it please tell me.

Thank you

[1209 byte] By [LukasSeitlingera] at [2007-11-27 11:27:27]
# 1

After searching the forums a little I have already found a solution to my problem.

instead of run.exec(pathToExecutable + parameters, null, ExecutePath)

I instead use run.exec(cmd /c start pathToExecutable + parameters, null, ExecutePath).

This now opens the console that displays the progress information and the process eventually exits and the VM continues to execute.

Apologies for the unnecessary post.

LukasSeitlingera at 2007-7-29 16:16:17 > top of Java-index,Java Essentials,New To Java...
# 2

Since you are not consuming the stdout/stderr, a buffer is most likely filling up and waiting for it to be consumed so it can send more.

You should read the following article completely before continuing:

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

jbisha at 2007-7-29 16:16:17 > top of Java-index,Java Essentials,New To Java...
# 3

Thank you jbish, the article was very helpful.

LukasSeitlingera at 2007-7-29 16:16:17 > top of Java-index,Java Essentials,New To Java...
# 4

> Thank you jbish, the article was very helpful.

Glad to help.

jbisha at 2007-7-29 16:16:17 > top of Java-index,Java Essentials,New To Java...