ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick (Gus) Heck" <patrick.h...@olin.edu>
Subject Re: ant 1.5 still following symlink on NT with followsymlinks set to false for javac and delete tasks
Date Fri, 26 Jul 2002 22:36:21 GMT
Ah, an interesting case... but probably insoluble :(.  The problem with
all symlinks is that java has no concept of symlinks at all. When I
wrote the patch that was the basis of the follow symlinks atribute, I
acomplished the distinction by (effectively) comparing a file built by
doing 

File((new File(fil.getParent())).getCannonicalPath(), fil.getName());

with a file built from 

File(fil.getCanonicalPath());

If it followsymlinks isn't behaving on your NT machines it is probably
because java is reporting the same name for cannonical and abosolute
paths. This is a limitation of java, and perhaps a bug in the
implementation you are using. I could also be that the reparse point you
are using isn't intended to behave quite the same as a symbolic link,
but really is intended to look just like a hard link. That is probably
what it is doing from java's perspective. If you can find a way to make
followsymlinks it work on NT please do so.

If you find that getCanonicalPath and getAbsolutePath do differ for
reparse points, then it is possible that we have a bug. Otherwise it is
a problem with the jvm, or with how reparse points were designed. 

The followsymlinks patch is named with the unix symlink name because it
is known to work on unix. Other systems which have similar features that
aren't quite the same are anticipated to have problems. It would be nice
nice to have a followreparsepoint atribute too if it can be done. I
don't have an NT machine to try it on. I might fool around with it at
home on my XP pro box, if junction.exe is retained in XP, but I am not
really set up to program on it (no CVS, no emacs, etc). I might get it
set up if I can se a solution though.

Meanwhile, good luck,
Gus

paul.yan@escalate.com wrote:
> 
> on NT, symlink can be created using junction.exe, as explained below.
> However,
> I don't want ant to traverse those symlinks as it gets into an infinite
> loop.
> does anyone know how to work around this problem?
> 
> thanks,
> 
> Paul
> 
> *       The Microsoft term for this feature is "reparse point"
> *       The command is called junction.exe
> *       Downloadable from
> http://www.sysinternals.com/ntw2k/source/misc.shtml
> *       Limitations:
>                 - Works only on Win2k and NTFS5 or greater
>                 - Deals with absolute symlinks only - no relative symlinks
>                 - Doesn't work on network drives or FAT filesystems
> *       The order of arguments is reversed from the UNIX ln command. The
> syntax is:
>               junction.exe destination source
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>

--
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