The mv() function doesn't work accross filesystems
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3072
Reported by Marek Habersack, The Caudium Group email@example.com
This is due to the fact that rename(2) uses hardlinks to rename the files and they don't work accross filesystems. The attached diff fixes it by using a file copy followed by an unlink in the situation when the destination is on a different filesystem than the source. The mv() semantics aren't changed, simply augmented that way.