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 14320] - copy fileset followsymlinks="false" does not copy symlinks at all
Date Thu, 07 Nov 2002 04:00:54 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=14320>.
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=14320

copy fileset followsymlinks="false" does not copy symlinks at all





------- Additional Comments From gus.heck@olin.edu  2002-11-07 04:00 -------
I presume OS should be set to one of the *NIX's? Please change it to your 
platform?

The reason for this behavior is that Java doesn't really have a concept of 
Symlinks. The key reason for followSymlinks was in reference to bug 1550 where 
the problem was that delete tended to go places it shouldn't without this 
atribute. 

There is no way to find out exactly what a link is. Symlinks are a unix 
specific OS feature, so because Java is supposed to be relatively platform 
independant, no means for this is provided. 

What can be done (in things like my recently submitted symlink task) is a 
careful comparison involving the difference between getAbsolutePath() and 
getCannonicalPath. This gives you ONE possible definition of a link to the 
resource in question. It does NOT give you the exact link that exists on the 
filesystem. What you get is an absolute version of the link. 

You can find detailed discussion in bug 1550.

Any relative links such as one in /home/gus/somedir

foo->../bar.txt 

will get converted to 

foo->/home/gus/somedir/bar.txt

by this method. So even if Ant tries to implement some form of link copying, 
it will completely mangle any relative links. I suspect you wouldn't be 
satisfied with this?

If you are willing to write a platform dependant build file, you can use the 
Apply task with the executable set to cp and passing an argument of -a to 
acheive an exact duplication of the "cp -a" behavior :).

If you want platform independance, you probably have to sacrifice platform 
specific features like symlinks.

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


Mime
View raw message