renameTo() is failing to move a file to another directory in Windows 2000 ?
Hi All,
I am trying to move a file from one directory to another. i don't have any files in the directory where i am moving. so there is no possibility of same file exist.
i also unable to find the reasons why it is not moving...
Can anybody help me on this? How to debug such problems? I think this is a flaw in the java since we could not able to trace the errors of these kinds of problems......
Why java doesn't handle such important scenerios?
Please help me...Its very urgent..
Thanks,
J.Kathir
[551 byte] By [
jkathira] at [2007-10-2 20:58:50]

Check the docs:
[url=http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#renameTo(java.io.File)]http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#renameTo(java.io.File)[/url]
Renames the file denoted by this abstract pathname.
Whether or not this method can move a file from one filesystem to another is platform-dependent. The return value should always be checked to make sure that the rename operation was successful.
If by "not deleting()" mean you are can't even delete it, then some process probably has a lock on it. Find out why, then should be able to move it. This is probably an operating system issue rather than a coding problem.