This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
My target is to run external exe file throught java programm and communicate with it.
i am able to get the out put of exe but faceing problem with blocking calls.. i will explain:
if i want to get out put of c program i.e. test.exe ( it will print hi on console if we run this file directly)
then by using following code
I get out put as
on java console
but if a c program has bloaking call in it
for example let test.c contains a code
now when i run executable file of above program(test.exe) using java code given above it will goes in
infinite waitting state.
i think the reasone is text.exe wait for user to give input but in this case user is a java program who
dont have any idea about that so process goes into infinite waitting condition..
So My question is
>>>>>>>>>>>>> WHAT TO DO ???
i want java program to print " Enter number = "
then user will give number
the number given by user to java program should be passed to
and final out put "You entertd =(number given by user) " should be printed on screen
You're Java program needs to read data from p.getInputStream(), then recognize when to send data to p.getOutputStream(). Unless you can tell it what data read requires what data to be sent this is not going to be easy.