This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

input and ouput problem with BufferedReader/Writer to external process

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22862
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you should read When Runtime.exec() won't.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic