ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <>
Subject Re: [PATCH] --> Re: delete error
Date Wed, 22 Aug 2001 16:37:36 GMT
Peter Donald wrote:

>The problem is that on quite a few different OSes the canonical and absolute 
>paths may differ. In particular case-insensitive file systems reak havoc and 
>are available on all major OSes. I am not sure there is a maintainable way of 
>doing this at the java level.
>However several people have asked for this and other system specific stuff. 
>Most of this stuff can be got at Posix level ... maybe for Ant2 we could have 
>a small wrapper around native code that twiddled with OS level things such as 
>this .. not sure.
It would definately be a good thing to have.  However there is an easy 
unix solution.
you can exec on the os the command

    if [ -h path ]; then exit 1; else exit 0; fi

what would be nice on the filepatterns is to be able check a certain
condition before executing the delete on the file.  what you could 
do is to have it exec this command, and check the return code.  If the 
return code
is non-zero, you don't execute the delete.  I think this would give a 
huge amount
of flexibility, while not disrupting the code too much.

I would think something like this would be useful:

<delete ....>

  <guard os="">
     <exec executeable="/bin/sh">
        <arg line="-c &quot;if [[ -d path && -h path ]]; then exit 1; 
else exit 0; fi&quot;" />


while it doesn't automatically solve the problem, at least it gives the 
option of the build file
writer to stop that stuff from happening.

Matt Inger (
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 

View raw message