Thanks for pointing out that I needed to pass the complete path, that was what
was missing .
It works great now.
Someone had pointed out that I needed to invoke the c shell command, that is
not
necessary and I don't think that it would work because I was passing the file
names as
parameters.
Using renameTo also helped.
It was all in the complete path.

thanks for all the help
Chitra

Mallik Arjun wrote:

> Hi,
>   Chitra
>   I did a cut and past of your code in one of
>   our servlet to test the move command on the unix system
>   It works fine with out any error!!!
>
>   Note that you have to specify the complet path of
>   the source file and the destination file from the root of the
>   unix system.
>
>   i.e if u have a file called chitra.txt in your home directory
>   to move it to ch.txt you have to specify
>   (assuming your home directory = /project/users/chitra)
>   sourcefile = /project/users/chitra/chitra.txt
>   destfile   = /project/users/chitra/ch.txt
>
>   (If your are not specifing the full path its not going to
>    move nor going to give u any errors!!!!)
>
>   make sure that permissions on the files are such that it
>   is possible for the owner of the Servlet Engine to move the
>   file from one name to other.
>
>   BTW please specify the servers on which your
>   are working in brief this will help for any one who are trying
>   to answer!
>
>   The specs of servers are
>   NetscapeEnterpriseServer3.5.1
>   ServletExece2.0
>
> hope this helps
>
> H.M.Mallik
>
> >From: Chitra Jain <[EMAIL PROTECTED]>
> >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
>
> _______________________________________________________________
> Get Free Email and Do More On The Web. Visit http://www.msn.com
>
> ___________________________________________________________________________
> 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
begin:vcard
n:Jain;Chitra
tel;fax:804 762-7888
tel;work:804 762-7477
x-mozilla-html:TRUE
org:Capital One Services, Inc.
adr:;;11011 W.Broad Street;Richmond;Viriginia;Internal Zip : 23060-0315;U.S.A
version:2.1
email;internet:[EMAIL PROTECTED]
title:Developement Associate
x-mozilla-cpt:;-11328
fn:Chitra Jain
end:vcard

Reply via email to