| Author |
File Moving on Mounted Devices (NFS/ Samba)
|
Z Zia
Greenhorn
Joined: Oct 03, 2004
Posts: 24
|
|
Hello, An Interesting Observation: We can move files from Java using renameTo() function, one of my solution is distributed in 3 tiers. First 2 on linux (NFS mapping) and 3 tier is on windows (Samba mapping). When I try to move files from one linux system folder to other (NFS) or linux system to windows system folder(samba), it doesn't returns any errors but files are not transmitted. Any clues? Regards, Zeeshan
|
 |
Stefan Wagner
Ranch Hand
Joined: Jun 02, 2003
Posts: 1923
|
|
If you move a file on a single device, only an entry in a filetable needs to be changed, for example from /mnt/hdf4/foo/bar.txt to /mnt/hdf4/bar/bar/bar/bar.txt. The file itself isn't read or written. It's just renamed. If you try to write it to a different device, it needs to be read and written, and can't just be renamed.
|
http://home.arcor.de/hirnstrom/bewerbung
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
|
renameTo() fails by returning "false"; it will generally fail when, as Stefan says, you try to rename something onto another device. You must always check the return value of "renameTo()" and fall back to bytewise-copying on failure.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: File Moving on Mounted Devices (NFS/ Samba)
|
|
|