I have used renameTo() in win2k and XP, the only time it failed
was when there was lock on the file.  What might be happening is that the
user that executing the renameTo doesnt have permission to access the
file.  I didn't use the renameTo that much because the app I was working on
used AWT classes to open an image file, later I had to rename the file, but
the AWT classes were not releasing the lock on the file. to find that out i
tested a lot with renameTo, but the files belonged to my user, and I had
admin privaleges.  So check out the privalages, normally if you can rename
it using windows explorer you should be able to using the application.

At 04:17 PM 8/26/2002 -0500, you wrote:
>Forgive me if this doesn't belong on this forum, but I did check the Sun
>listing of Java forums, and did not find one that matched the Java.IO
>libraries.
>
>As part of my web application, I am attempting via a Java class (NOT a bean
>that runs in my web apps, but a separate class file that runs as a console
>application) to rename a txt file that is FTP'd over to my server.  The file
>is saved by the FTP program to my web applications subdirectory under IIS's
>InetPub subdirectory.  The server is a Windows 2000 application server
>running JRUN 3.1 and IIS 5.0.
>
>Bottom line, I am unable to get the method File.renameTo() to work.  I've
>done some research on this issue via Google and the Sun listservers, and
>have found that this method of the File object often does NOT work on
>Windows servers due to some type of Windows security issues.  I need to
>rename this file by appending the system date to the beginning of the
>filename, otherwise the file will be overwritten the next day when my
>customer FTP's a new file over to me.  Does anyone have any suggestions as
>to how I can rename this file successfully?  I am reluctant to use
>runtime.exec() to start another thread, but I will do so if I have no other
>options.
>
>Thanks in advance for any assistance on this issue!
>
>Celeste Haseltine, PE
>MTL, Inc
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

cya,

Tiago Nodari
Need a JSP Developer? I am looking for a job in the US...
www.nodari.org

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to