wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Move File from one directory to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Move File from one directory to another " Watch "Move File from one directory to another " New topic
Author

Move File from one directory to another

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

I am trying to move File from one directory to another directory using renameTo Option , but i am always getting false as the return type , with no Exception .



Please help


Save India From Corruption - Anna Hazare.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18125
    
    8

Presumably C:\Two already exists (perhaps it's actually the directory you wanted to move the file to), so you can't rename C:\One\sai.txt to that. Did you actually want to rename it to C:\Two\sai.txt? If so then do that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Move File from one directory to another
 
Similar Threads
problem opening a new word file
Opening CSV file in ReadOnly while writing data to it
file.renameTo() fails
renaming an uploaded file
Usage of list() with File to search files and directories