• Post Reply Bookmark Topic Watch Topic
  • New Topic

input and ouput problem with BufferedReader/Writer to external process  RSS feed

 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the issue. java program starts and launches an external program. I get the inputstream and outputstream of that process to play with. I can pipe all the inputstream information to a textarea just fine however... its when i want to give input to the outputstream that the problem occurs. I believe I'm just thinking of this the wrong way and am coming here for help.
Also if anyone looking at this code can knows how I can differentiate from a process that needs input to one that does not that would be great as well.

here is the sample code and the following ruby script I used for the external program...



here is the simple ruby script i am using...



again any help is appreciated.

Thanks in advance,

Christopher Dancy
[ December 30, 2008: Message edited by: Martijn Verburg ]
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,

Are you getting any errors? Or are you not seeing your writes executed?
 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No errors at all... The code just sits and waits ... The BufferedWriter is blocking for some reason, because if i dont even include it the program simply spits out the lines of the processes output, however when i do include it the program just sits and waits. And it waits at the loop, when a line is trying to be read and will not even continue further into the loop. The point of why im trying to do this is to make a small ide for my senior project and i want to mimic a console/terminal in the bottom pane like most ide's do. I simply cant seem to get this working and i've tried everything at this point. Sorry for getting back to you so late.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should read When Runtime.exec() won't.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!