You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by pauly <pa...@x-radio.com> on 2000/03/31 01:09:45 UTC
ANT tag
Quick question: Does Ant follow symlinks when it's deleting trees? The
reason I ask is because I had some _very_ important items symlinked into
my development tomcat webapps directory and after executing $(ANT) clean
they've disappeared. Is this right???
Re: ANT tag
Posted by William Uther <wi...@cs.cmu.edu>.
Hi,
This 'fix' doesn't work on some systems. I'm not sure which system
caused problems for Costin, but it fails on a Mac.
File.getCanonicalPath() is system dependant. In particular, on a Mac,
the filename returned ends in a '/'. This is different to the behaviour of
File.getAbsolutePath(). Hence, these will never be equal on a mac. You
can fix this by normalizing for the existance of a '/' at the end of the
paths.
Also, the simple existance test shown below tests if there is a symlink
anywhere in the path, NOT if the path target is a symlink. I believe there
was other code elsewhere that got the canonical path when you started to
remove all other symlinks but, based on Costin's report, this didn't work
all the time.
later,
\x/ill :-}
--On Tuesday, April 4, 2000 12:11 AM -0700 ja@almery.com wrote:
> jon * writes:
> > on 4/2/00 10:27 PM, ja@almery.com <ja...@almery.com> wrote:
> >
> > > I can't convince cvs to allow me to log in (anonymously) to get the
> > > latest source, but at one time this also happened to me. I submitted
> > > a patch, which tested to see if the "directory" was a symlink, and
> > > ignored it if it was. The patch was committed by someone, and all
> > > seemed well.
> >
> > submit the patch again...i will get it checked in.
> >
> > really this conversation should be going on the ant-dev mailing list.
>
> I looked at the source via cvsweb (I wonder why my logins time out
> with "regular" anonymous cvs?) and noticed that costin commented out
> the "fix"
>
> // if
> (dir.getCanonicalPath().equals(dir.getAbsolutePath())) { //
> (costin) It will not work if /home/costin is symlink to
> /da0/home/costin ( taz // for example )
>
> So, it looks as though the dangerous behaviour of Deltree has
> returned.
>
> --
> Jay Doane | doane@acm.org
Re: ANT tag
Posted by ja...@almery.com.
jon * writes:
> on 4/2/00 10:27 PM, ja@almery.com <ja...@almery.com> wrote:
>
> > I can't convince cvs to allow me to log in (anonymously) to get the
> > latest source, but at one time this also happened to me. I submitted
> > a patch, which tested to see if the "directory" was a symlink, and
> > ignored it if it was. The patch was committed by someone, and all
> > seemed well.
>
> submit the patch again...i will get it checked in.
>
> really this conversation should be going on the ant-dev mailing list.
I looked at the source via cvsweb (I wonder why my logins time out
with "regular" anonymous cvs?) and noticed that costin commented out
the "fix"
// if (dir.getCanonicalPath().equals(dir.getAbsolutePath())) {
// (costin) It will not work if /home/costin is symlink to /da0/home/costin ( taz
// for example )
So, it looks as though the dangerous behaviour of Deltree has
returned.
--
Jay Doane | doane@acm.org
Re: ANT tag
Posted by jon * <jo...@clearink.com>.
on 4/2/00 10:27 PM, ja@almery.com <ja...@almery.com> wrote:
> I can't convince cvs to allow me to log in (anonymously) to get the
> latest source, but at one time this also happened to me. I submitted
> a patch, which tested to see if the "directory" was a symlink, and
> ignored it if it was. The patch was committed by someone, and all
> seemed well.
submit the patch again...i will get it checked in.
really this conversation should be going on the ant-dev mailing list.
-jon
ANT tag
Posted by ja...@almery.com.
pauly writes:
> Quick question: Does Ant follow symlinks when it's deleting trees? The
> reason I ask is because I had some _very_ important items symlinked into
> my development tomcat webapps directory and after executing $(ANT) clean
> they've disappeared.
I can't convince cvs to allow me to log in (anonymously) to get the
latest source, but at one time this also happened to me. I submitted
a patch, which tested to see if the "directory" was a symlink, and
ignored it if it was. The patch was committed by someone, and all
seemed well.
> Is this right???
No, it sucks.
--
Jay Doane | doane@acm.org