File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Runtime.getRuntime().exec() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Runtime.getRuntime().exec()" Watch "Runtime.getRuntime().exec()" New topic


Nilesh Joshi

Joined: Nov 10, 2004
Posts: 4

i am using Runtime.getRuntime().exec to unzip files on linux server, but after running it, some times i get list of filenames by File.list() and some times i dont, can any one tell me why?

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Mostly guessing here ...

Are you reading the outputs of the zip program? If not, there may be messages there that you are missing.

Any chance the zip contains paths and is putting the files somewhere you don't expect?

Have you looked into the Zip streams? You can read the zip file to extract the members and write them anywhere you like. Can't say if that would be a good idea or not.

Let me know if any of that helps.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: Runtime.getRuntime().exec()
jQuery in Action, 3rd edition