Results 1 to 2 of 2
Thread: renameTo() not working remotely
- 08-09-2012, 09:57 PM #1
Member
- Join Date
- Jul 2010
- Location
- Lima, Peru
- Posts
- 47
- Rep Power
- 0
renameTo() not working remotely
I'm using the file.renameTo() method to rename files remotely.
This code works:
Java Code:File f1 = new File("C:\\hi.txt"); File f2 = new File("C:\\hi2.txt"); f1.renameTo(f2);
This code does NOT work.
Java Code:File f1 = new File("\\\\computer\\C:\\hi.txt"); File f2 = new File("\\\\computer\\C:\\hi2.txt"); f1.renameTo(f2);
Also. It is not a permissions issue because I have tested this with the local computer name and it doesn't work. Maybe it has something to do with the formatting of the paths?
Doesn't work:
Java Code:File f1 = new File("\\\\localcomputer\\C:\\hi.txt"); File f2 = new File("\\\\localcomputer\\C:\\hi2.txt"); f1.renameTo(f2);
No errors are returned. Much help would be appreciated, or perhaps an alternative to renameTo() that would allow me to rename files remotely.
I don't really trust the copy and then delete method... especially when working with really important files.
Thank you!
- 08-09-2012, 10:03 PM #2
Member
- Join Date
- Jul 2010
- Location
- Lima, Peru
- Posts
- 47
- Rep Power
- 0
Similar Threads
-
How can client gain access to my RMI server remotely?
By ChexWithRaisins in forum NetworkingReplies: 16Last Post: 01-07-2012, 10:15 AM -
f.delete() and f.renameTo() does not work
By doobybug in forum New To JavaReplies: 6Last Post: 08-08-2011, 11:48 PM -
Disk Space Checker for Windows and Linux remotely.
By itsnexgen in forum New To JavaReplies: 3Last Post: 06-14-2011, 11:27 AM -
remotely access video stream from camera
By adityapr in forum NetworkingReplies: 1Last Post: 05-03-2011, 10:07 PM -
Question about File renameTo() method : Abnormal output
By suvojit168 in forum New To JavaReplies: 1Last Post: 07-25-2009, 08:22 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks