• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use Process.destroy()  RSS feed

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Process proc = runtime.exec("ls");

i want to have something like boolean stop ..if it is true i want to kill the proc
something like :
if (stop)
proc.destroy();
but it is not working ..so what is missing
 
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's highly unlikely the ls command is still running by the time you run a conditonal statement to kill it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!