chaithu
Originally posted by Paul Clapham:
The shell command never finishes because it is writing something to stdout. When the buffer fills up, it waits for your program to read that data. But your program doesn't read the data, it waits for the shell command to finish. Deadlock. Read from child.inputStream() -- which is the shell's stdout -- or child.errorStream() -- which is stderr.
chaithu
Originally posted by Henry Wong:
Not really answering your question... just pointing out that there are other exec() methods which does exactly what you want, and easier to use.
Henry
chaithu
Originally posted by Henry Wong:
This is not a valid bash command...
Why did you decide not to do it the way I showed you?
Henry
[ May 07, 2006: Message edited by: Henry Wong ]
chaithu
one more doubt here where we are changing dir to file_location?
Originally posted by Henry Wong:
Take a look at the example that I showed you... You still have differences.
The version of exec() that I am using is specifying a current working directory. One of the operations prior to executing the command is changing to the current working directory.
Henry
chaithu
Wrong number of arguments in method.
Process child = rtime.exec(cmd, null, file_location);
^
1 error
After ln and -s cmd is any space required ?
Originally posted by Henry Wong:
Possible issue... the version of exec() which takes a current working directory was added in Java 1.3.
What version of Java are you using?
Henry
chaithu
Originally posted by RamaShankar Miryala:
I am using the below mentioned version.
java version "1.2.2"
Solaris VM (build Solaris_JDK_1.2.2_10, native threads, sunwjit)
let me know how to resolve this one in this version.
Thanks
chaithu
Originally posted by Paul Clapham:
The shell command never finishes because it is writing something to stdout. When the buffer fills up, it waits for your program to read that data. But your program doesn't read the data, it waits for the shell command to finish. Deadlock. Read from child.inputStream() -- which is the shell's stdout -- or child.errorStream() -- which is stderr.
Does it mean I should keep reading the error and inputStream one command after another? Or just read at the end of all commands?
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|