You might want to look into the java.io.File.renameTo method...it's
a lot easier than troubleshooting subprocesses.

Rod McChesney, Korobra Corporation


Chitra Jain wrote:
>
> 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