Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

process wait or pause feature needed for java code

 
jay start
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is some code that work without a problem. My issue is, I need to insert some java code to:

1) pause and/or wait for the tftp process to finish, then;
2) execute the downloaded router image.

I can only manage to get the router_image downloaded. I'm stumped on how to carry it farther and do 1 and 2, above.

Any help much appreciated.

 
Nick Puketza
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jay,

As for the waiting, I am not sure, but you might check out the Process class description
in the API specification. The waitFor() method looks promising.

http://java.sun.com/javase/6/docs/api/java/lang/Process.html
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4501
268
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"jay start", please check your private messages regarding an important administrative matter.
 
Rob Spoor
Sheriff
Pie
Posts: 20546
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nick Puketza wrote:Hi Jay,

As for the waiting, I am not sure, but you might check out the Process class description
in the API specification. The waitFor() method looks promising.

http://java.sun.com/javase/6/docs/api/java/lang/Process.html

Which requires one to have read the Javaworld article "When Runtime.exec() won't".
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I shall move this thread because it is more difficult than we expect for "beginning Java".
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not use a Java FTP library and bypass the vagaries of exec()?
 
jay start
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Welcome to the Ranch

I shall move this thread because it is more difficult than we expect for "beginning Java".


Can you tell me to where you moved it so I can go there and follow up? Thank you.
 
jay start
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Why not use a Java FTP library and bypass the vagaries of exec()?


That looks very promising. Any idea on the general structure of how I could do that with this code? Thank you.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just call a non-asynchronous FTP method; when it returns it's done.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jay start wrote: . . . tell me to where you moved it so I can go there and follow up? Thank you.
Here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic