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
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: 18541
    
    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
file.renameTo() fails
Opening CSV file in ReadOnly while writing data to it
Usage of list() with File to search files and directories
renaming an uploaded file
problem opening a new word file