| Author |
Communicating with unix command process from java using stream
|
megha joshi
Ranch Hand
Joined: Feb 20, 2007
Posts: 206
|
|
Hi all,
I want to use stream based IPC in Java. To test this I am trying to exec unix more filename command from my java code. Interesting thing is commands like ps, man, ls -l execute fine using the code below. But executing more on a big file , which requires enter input from keyboard occasionally fails. I would like to give input to this unix process from my java code..but I am not sure how to do that. The code I have so far is as follows:
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Search for the Javaworld article "When Runtime.exec() won't". It's a must-read when working with Processes.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
megha joshi
Ranch Hand
Joined: Feb 20, 2007
Posts: 206
|
|
|
Thanks..I went through it though issues mentioned in the article, are not relevant for this case. Any other suggestions? Thanks again!
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
megha joshi wrote:issues mentioned in the article, are not relevant for this case.
Are you sure? Perhaps the process is being paused because its output / error buffer is full, something that is very clearly discussed in the article. Once you clear the output and error buffers it may continue again.
|
 |
 |
|
|
subject: Communicating with unix command process from java using stream
|
|
|