Ahh.... the infamous problem!!!

You gotta start a new shell and pass it the arguments to execute (the "mv")

I think t'was something like

       "csh -c", "mv xxx yyy"

the -c is to notify the shell that arguments to be executed are to follow,
as I remember.

Thank you Jason for bringing it up in your book

Cheers,


Tammam Al-Hamwy
Software Engineer
IBM Corp.




Chitra Jain <[EMAIL PROTECTED]> on 04/15/99 03:07:56 PM

Please respond to "A mailing list for discussion about Sun Microsystem's
      Java              Servlet API Technology."
      <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:    (bcc: Tom Al-Hamwy/Toronto/IBM)
Subject:  unix commands from a servlet





I am trying to move files using the "mv" command on Unix from a servlet
where the names of the files
are passed in as parameters.

This is what I have in my moveFiles(String sourceFile, String destFile)
method

Runtime rt = Runtime.getRuntime();
Process proc = null;

String[] command = {"mv", sourceFile, destFile};
proc = rt.exec(command);

But for some reason I can't get it to work. There are no errors returned
from the system either
What am I doing wrong here. Any pointers ?.
Thanks in advance.

Chitra

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to