• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sending input to an app ran by exec command

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
I Wasn't here for a long time...
I've got a question :
Inside my code , I'd like to run ( probably with exec ) an external .exe file.
After a while, I'd like to send to that external .exe file which is in execution, some data input instead of having a real user typing on the keyboard for that application.

Just a small example for those who didn't understand the question :
Lets say I've got a file called : 1.exe
And for the sake of explaining lets say that all the application 1.exe does is write to the screen : "What is your name?" and wait for an input.

In my code, I'd like to execute that file called 1.exe and after a while ( lets say after 5 minutes ) I'd like to have my code able to send input to the application 1.exe .

Does anybody know how can I do that ?
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Proces class has both input and output methods for conneting to the running process. Try using getOutputStream().
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic