Geoff Jefferson wrote:In my programs I've always entered the path with the backslash.
This is LINUUUUUUUUUUUUUUUX!!! sorry, couldn't help it But seriously, Linux uses / instead of \ so that's definitely not the problem.
Vikas, do you have enough rights on both the source folder (/home/CSVFileParsing/Source), destination folder (/home/CSVFileParsing/Archive/) and their shared parents (/home/CSVFileParsing/ and /home/). In other words, can you move the file from the command line:
If not then you can try in Java all you want, but the file system is holding you back.
Ernest Friedman-Hill
,
author and iconoclast
staff
Another possibility: Is one of those directories on a separate filesystem? renameTo() won't work in that case, you'll have to move (i.e., copy/delete) the file.
Ernest Friedman-Hill wrote:Another possibility: Is one of those directories on a separate filesystem? renameTo() won't work in that case, you'll have to move (i.e., copy/delete) the file.
Not quite. I have successfully used renameTo on Windows between different partitions, and even with network shares.