ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <ma...@sedonacorp.com>
Subject [PATCH] Delete.java --> Re: delete error
Date Wed, 22 Aug 2001 15:06:00 GMT
Bill.J.Fellows@mail.sprint.com wrote:

>It's a known feature.  To delete symbolic links, one must shell out to 
>the OS to remove it.  I don't know about 1.4 and whether it deletes the 
>link instead of the target.
>
>/bill
>
>-----Original Message-----
>From: matti [mailto:matti@sedonacorp.com]
>Sent: Wednesday, August 22, 2001 9:04 AM
>To: ant-dev
>Cc: matti
>Subject: delete error
>
>
>has anyone else noticed that when you do a "delete" operation, it 
>follows symbolic
>links?  This is really bad, especially for those of use using RCS 
>and/or 
>SCCS, when
>we want to delete a checked out build structure automatically.  Is this 
>fixed in Ant1.4?
>
take a look at the above patch file.  It will take care of the symbolic 
link problem,
at least on unix.  The way to tell a symbolic link is to compare the 
absolute path name
of the file, which the canonical path name.

The absolute path name is the path name relative to where the symbolic 
link is.
The canonical path name is the REAL path to where the symbolic link points.
So you only delete the contents of a directory if these two are exactly 
equal.
Then regardless of that, you delete the directory.

NOTE:  it is legal to simply delete a directory which is a symbolic 
link, even if the
directory it points to is not empty.

-- 
Matt Inger (matt.inger@sedonacorp.com)
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 



Mime
View raw message