aspose file tools*
The moose likes Servlets and the fly likes System call using Runtime object question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "System call using Runtime object question." Watch "System call using Runtime object question." New topic
Author

System call using Runtime object question.

Jeff Madrid
Greenhorn

Joined: Nov 07, 2003
Posts: 14
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


Jeff
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
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

Joined: Nov 07, 2003
Posts: 14
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: System call using Runtime object question.