Hello,
I was wondering if anyone could help me please?
I'm using Java1.4 on Windows 2000 and I'm having some difficulty with the renameTo() method.
When I run this code:
import java.io.File;
public class Tester {
boolean isRenamed = true;
public static void main(
String[] args){
File newFile1 = new File ("/uploads", "temp.txt");
File newFile2 = new File ("/uploads", "temp2.txt");
boolean isRenamed = newFile1.renameTo(newFile2);
System.out.println(isRenamed);
}
}
I keep on getting false returned. The 2 files do exist, are readable, are not in any TEMP folder and are in the same drive that
Java is installed on.
Can anyone suggest anything please ?
Thanks in advance,
Trish.