| Author |
Unable to rename file
|
Siddhesh Khedekar
Ranch Hand
Joined: Nov 09, 2009
Posts: 31
|
|
Hi Experts,
I am tryin following code -
The folder D:\test already exists.
but not able to rename the file and getting output
Results.dat
Results.dat
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
File.renameTo does not change the File object. If it returns true it renames the file, yes, but the File object is immutable and stays exactly the same. Instead of using the old value of f you should reassign it:
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Unable to rename file
|
|
|