https://bz.apache.org/bugzilla/show_bug.cgi?id=65499
--- Comment #2 from [email protected] --- (In reply to Stefan Bodewig from comment #1) > I believe Eclipse code would return false in some edge cases involving > symlinked directories and non-existent files inside of them where the In the file copy case / eclipse we can be sure the sources exist - otherwise we can't copy it anyway. > current Ant code would return true - therefore I've left in a fallback for > the case where the first file doesn't exist: The two names: "/existingPath/nonExistingFile" "/symlinkTo_existingPath/nonExistingFile" may (unix - follows links) or may not (windows - doesnt follow links) resolve to the same canonical name "/existingPath/nonExistingFile" or sinc. So isSameFile() may be OS dependend. I doubt you want isSameFile() behave OS dependend. OS independent would be to return always false for nonExistent files. If f1 exits but f2 doesnt exit - can they be the same? I would say no. (Nevertheless you may have rights to access "/existingPath/nonExistingFile" but not to access "/symlinkTo_existingPath/nonExistingFile") If you know any more strange edge cases i would be interested to know. > https://github.com/apache/ant/commit/ > 4da6c49b048691282c79a731b69517be088d938e/ Thanks! There would be still room to get rid of that costly sourceFile.exists() in the ResourceUtils.copyUsingFilChannels case. For curiosity one more edge case: Also the two file names "com1.extention1" "com1.extention2" may (windows - CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9 are special device names - and the file extentions are discarded) or may not (linux - no special file names) resolve to the same canonical name "\\.\com1". Windows returns file.exists() for all of them even when those devices do not exist. -- You are receiving this mail because: You are the assignee for the bug.
