>From my build.xml:

<target name="clean" unless="fast">
        <!-- Delete the ${build} directory trees -->
        <delete dir="${build}" />
</target>

note the '/>' at the end of <delete dir.. tag.
It seems that the are missing from your previous atempts...

You might also try to remove the last '/' at the end of '<fileset
dir="${variable1}/dir1/">'
I have experienced that '/' at the end of some dir causes truble...
-- Arvid

-----Original Message-----
From: Gary Lawson [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 15:50
To: [EMAIL PROTECTED]
Subject: Deleting directories


Firstly, apologies for what (I hope) is a simple question.

I am simply trying to delete the contents (files and sub-directories) of a
number of directories.
ant appears to be ignoring the contents of my target.

The code is as follows:

<target name="clearup">
        <delete verbose="true">
                <!-- delete everything from /variable1/dir1 -->
                <fileset dir="${variable1}/dir1/">
                        <include name="**" />
                </fileset>
                <!-- delete everything from /variable2 -->
                <fileset dir="${variable2}/">
                        <include name="**" />
                </fileset>
                <!-- delete directory /variable1/dir2/variable3 -->
                <fileset dir="${variable1}/dir2/">
                        <include name="${variable3}" />
                </fileset>
        </delete>
</target>

The variables are all defined and work in other targets.

Other things I've tried (without success):
defaultexcludes="no" - deprecated
comma separated list instead of filesets
One "delete" for every dir
        <delete dir="${variable1}/dir1/">
        <delete dir="${variable2}/">
        <delete dir="${variable1}/dir2/${variable3}"

I don't believe it's file permissions as I'm running ant as root and root
owns the directories and files in question.

Any ideas what I'm doing wrong? I'm going daft!

TIA

Gary

Reply via email to