Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System call using Runtime object question.

 
Jeff Madrid
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's my code:

String[] cmd =
{"/usr/sbin/myCommand", "myParam", "/home/myHomeDir/myFile"};
Runtime.getRuntime().exec(cmd);

I'm running RedHat Linux. No exceptions are thrown but nothing happens to my file.

Question: What's wrong?

Thanks in advance.

Jeff
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, not exactly a Servlets question methinks...

There's more to Runtime.getRuntime().exec() than meets the eye. Check out this article from JavaWorld.com, which is a bit old but should tell you what you need to know.

Jules
 
Jeff Madrid
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I check the article out.

BTW, I forgot to mention I'm making the call from a Servlet. Still not exactly a Servlet question tho.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic