ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15031] - ANT <copy> with <fileset> does not spot bad symlinks
Date Wed, 23 Jul 2003 22:48:39 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15031>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15031

ANT <copy> with <fileset> does not spot bad symlinks





------- Additional Comments From john.lonergan@ubsw.com  2003-07-23 22:48 -------
Lets say the symlink issue is a red herring.

The underlying problem is that Ant is not detecting unreadable or nonexistant 
files consistently and so my builds are apparently suceeding where infact the 
is a problem in our package and fies are missing - this is bad however you look 
at it.

I have already demonstrated that ant can be tightened up so that it reports an 
error in the case where the directory says the file exists but io.File reports 
it as notexistant

Ant does correctly detect that it can't copy a regular file that is 
permissioned as unreadble but it doesn't detect the case I mention above.

Lets focus on detection of files that cannot be read (for whatever reason) and 
not let symlink detection sidetrack us.

Anyway looking at CopyDir.java I see that scanDir does this 
(srcFile.lastModified() > destFile.lastModified())) 

According to the JDK API docs ... "lastModified() Returns: ... 0L if the file 
does not exist or if an I/O error occurs". 
So for my dead link lastModified() is returning 0 (to indicate an error) and 
the lack of error detection code tricks the method into  thinking a copy is not 
required. 
To test this I set the overwrite="yes" attribute. Hey presto ant now dies when 
it encounters the dead sym link. 
So the code should actually be detecting the error value zero returned from 
lastModified() and in the case of the source file it should treat this as an 
error.

So right now ant behaves inconsistently. 
-If you explicitely tell ant to copy a dead link then it detects this and 
failed.
-If you are copying a dir and set overwrite='yes' then it detects dead links 
within dirs.
-If you are copying direct and -don-t  set overwrite="yes" then ant fails to 
detect the unreadable dead link.

So perhaps the focus of this discussion should be on making ant behave 
consistently with respect to unreadable and nonexistant files - ie abort.

Thx John

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message