Hi,
I'm trying to fix the SegmentMergeTool, and I found out that LocalFileSystem is not working for me most of the time.
As I reported before, the reason seems to be an unclear semantics of java.io.File renameTo() and delete(), and the way they are used in LocalFileSystem.
Regarding renameTo(): initially I thought that Windows can rename files and directories across volumes, substituting in background "copy and delete" for "rename" as needed. Well, it is like that, sort of - except it only works for plain files, and not for directories. On Unix (FreeBSD, Linux) renaming across volumes does not work, no matter if it's a file or directory. This means that in many cases where temporary files are copied around (or NFS.addLocalFile() is called) source and destination will lie on different volumes, and such operations will fail... This also means that LocalFileSystem should use "copy and delete" strategy in most cases. This brings performance penalty for in-volume renaming, so this case should be detected somehow (?).
Regarding delete(): both on Windows and on Unix this operation fails if directory is not empty, so we should always use FileUtil.fullyDelete() instead of the currently used File.delete().
I'll prepare a different patch and send it for review.
-- Best regards, Andrzej Bialecki
------------------------------------------------- Software Architect, System Integration Specialist CEN/ISSS EC Workshop, ECIMF project chair EU FP6 E-Commerce Expert/Evaluator ------------------------------------------------- FreeBSD developer (http://www.freebsd.org)
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Nutch-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nutch-developers
