Thanks Peter - but since I am excluding temp, I did not expect ant to even go into temp to delete anything inside of it...
Tracy -----Original Message----- From: Peter Reilly [mailto:[EMAIL PROTECTED] 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 <[EMAIL PROTECTED]> 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 > > > > [EMAIL PROTECTED]:~/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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
