This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
hi, i am trying to move a directory from c:\ to d:\. right now i am using this code:
this works fine, as long as i try to move the dir from c:\ to c:\programs or from c:\prgrams to c:\programs\hello. but as soon as i change the partition (c:\ to d:\) success is always false. can you imagine why?
Whether or not this method can move a file from one filesystem to another is platform-dependent.
That's it. As to your question why: because it is the documented behaviour of the function. I am affraid you will have to copy file by file and then at the end remove the source.
Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>
Joined: May 10, 2004
hello, oh i see. but what if i do not have the permission to delete the directory after copying it?
Joined: Apr 28, 2004
The only thing I can tell you is: It is not trivial to move a directory. Many things can go wrong and this permission to delete is only one of them. You can: - notify user that it was copied but not removed (I think most file managers would do this) - delete what you have copied so far - ask user what to do - ...