ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tracy Jones" <tr...@stratalight.com>
Subject RE: possible delete bug??
Date Wed, 31 Jan 2007 23:11:55 GMT
Thanks Peter - if I specify this as my excludes - it works

<target name="test" depends="depends" >
   <property name="keepfiles" value="temp/** a/** b/** c/** d/**"/>
   <delete quiet="false" verbose="true" includeemptydirs="true" >
      <fileset dir="/home/sluser/test" excludes="${keepfiles}">
         <include name="*/**" />
      </fileset>
    </delete>
 </target>

-----Original Message-----
From: Peter Reilly [mailto:peter.kitt.reilly@gmail.com] 
Sent: Wednesday, January 31, 2007 1:30 PM
To: Ant Users List
Subject: Re: possible delete bug??

1) you are excluding "a", not "temp/a"
2) java does not expose symbolic links so
   the delete task does not know that "a" is a symbolic
   link, it thinks it is a directory and follows it.

Peter




On 1/31/07, Tracy Jones <tracy@stratalight.com> wrote:
> Hi - I have the following target that is meant to delete all files in
a
> directory except for the ones in a list
>
>
>
>
>
> <target name="test" depends="depends" >
>
>                 <property name="keepfiles" value="temp a b c d"/>
>
>                 <delete quiet="false" verbose="true"
> includeemptydirs="true" >
>
>                         <fileset dir="/home/sluser/test"
> excludes="${keepfiles}">
>
>                                 <include name="*/**" />
>
>                         </fileset>
>
>                 </delete>
>
>         </target>
>
>
>
>
>
> The directory temp contains sym links to directory a and b
>
>
>
> sluser@StrataLight:~/test$ ls -Rl
>
> .:
>
> total 4
>
> drwxr-xr-x    2 sluser   sluser       1024 Jan 24 22:09 a
>
> drwxr-xr-x    2 sluser   sluser       1024 Jan 24 22:09 b
>
> drwxr-xr-x    2 sluser   sluser       1024 Jan 24 22:09 c
>
> drwxr-xr-x    2 sluser   sluser       1024 Jan 24 22:09 temp
>
>
>
> ./a:
>
> total 0
>
>
>
> ./b:
>
> total 0
>
>
>
> ./c:
>
> total 0
>
>
>
> ./temp:
>
> total 0
>
> lrwxrwxrwx    1 sluser   sluser          4 Jan 24 22:09 a -> ../a
>
> lrwxrwxrwx    1 sluser   sluser          4 Jan 24 22:09 b -> ../b
>
>
>
> Then I run my script, delete tries to delete the directory temp even
> though it is contained in the exclusions.  If I do not have sym links
> inside temp, this works properly.
>
>
>
> test:
>
> Setting project property: keepfiles -> temp a b c d
>
> fileset: Setup scanner in dir /home/sluser/test with patternSet{
> includes: [*/**] excludes: [temp, a, b, c, d] }
>
>    [delete] Deleting /home/sluser/test/temp/b
>
>
>
> BUILD FAILED
>
> /var/stratalight/home/sluser/test.xml:18: Unable to delete directory
> /home/sluser/test/temp/b
>
>
>
> Is this a bug?  Or a feature :-)
>
>
>
> Tracy
>
>
>
>
>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message