ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David McTavish <dmctav...@sandvine.com>
Subject RE: deleting specific directories...
Date Fri, 27 Jun 2003 13:13:41 GMT
Could you use the available condition and call an external task using if?

ie:

<available property="file.exists" file="xxx"/>
<antcall target="delete.dir"/>

<target name="delete.dir" if="file.exists">
	<delete dir="${file.name}/.."/>
</target>

Although, I imagine you're using a fileset to determine the list of files...
Perhaps you could use the ForEach task from ant-contrib and iterate through
each file and call a target that will delete the parent. 
ie:

<foreach target="delete.dir" param="file.name">
    <path>
       <fileset .../>
    </path>
</foreach>

d.


-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Friday, June 27, 2003 9:03 AM
To: user@ant.apache.org
Subject: Re: deleting specific directories...


On Fri, 27 Jun 2003, Rob van Oostrum <rob@springwellfarms.ca> wrote:

> <containsregexp> should do it right?

<containsregexp> looks into the files - the request is to match on
file names.  And in particular, do not delete the matched files, but
its parent directory.  I've tried to come up with a combination of
existing selectors but failed.

Stefan

---------------------------------------------------------------------
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