This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes File renameTo not working Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "File renameTo not working" Watch "File renameTo not working" New topic
Author

File renameTo not working

jin sun
Ranch Hand

Joined: Feb 16, 2005
Posts: 30
This is frustrating, I had it working a while ago but now it isn't working. The renameTo is returning false but I deleted the file with the same name that I'm trying to rename and closed the output and input streams. I also checked the permissions. Anyone have a clue what I'm doing wrong? Thanks in advance.


[ June 20, 2005: Message edited by: jin sun ]
Miguel Roque
Ranch Hand

Joined: Oct 24, 2002
Posts: 126
Hi.

A couple of months ago a friend have asked for my help in a similar situation. The renameTo was not working and the problem was on the file path as he was trying to rename with only the file name. Try to include the complete path for the file, for example,



Miguel
jin sun
Ranch Hand

Joined: Feb 16, 2005
Posts: 30
Ohhh ok, thanks a lot Miguel.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: File renameTo not working
 
Similar Threads
filereader
Write a new Line
I/O code exception
close() method; I/O class chaining
reverse the text file and write