Gert,
I'd like a parameter added to the delete task (or maybe the fileset task)
specifying whether directories should be deleted.
When I used the <fileset> task I expected only the files to be removed.
Bob,
The script below in target "use_foreach" will delete all files below
${DelDir} and leave the directories in place.
I tried to get it to work using target "use_fileset" but the directories
always got deleted.
<project name="TestDelete" default="Default">
<property name="DelDir" value="C:\Projects\TestDel" />
<target name="use_foreach" >
<foreach item="File" property="filename">
<in>
<items>
<includes name="${DelDir}\**" />
</items>
</in>
<do>
<delete file="${filename}" />
</do>
</foreach>
</target>
<!--
<target name="use_fileset" >
<delete>
<fileset>
<includes name="${DelDir}\**" />
</fileset>
</delete>
</target>
-->
</project>
Thanks,
Noel
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bob Archer
Sent: Monday, April 05, 2004 7:04 AM
To: [EMAIL PROTECTED]
Subject: [Nant-users] Deleting files?
Ok,
What the trick to deleting all files from directory and still leaving the
directory intact.
I have obviously tried everything except for the correct thing...
I basically want the equivalent of:
Del c:\directory\*.* /s
So, directory still exists after the delete. This is so I can delete the
previous build from the staging servers virtual directory before moving the
new build there.
Thanks in advance!
BOb
<<attachment: winmail.dat>>
