You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Fletcher, Michael (Calgary)" <MF...@petro-canada.ca> on 2006/03/27 18:52:49 UTC

Removing only the Children of a folder

Hello

I am trying to remove almost all of the files in a folder except for the
"Logs" folder and the folder itself.  Unfortunately if the folder
doesn't contain any Logs then the whole folder is removed.

This is a snippet of my build.xml.

-- CUT
<delete verbose="true" includeemptydirs="true">
	<fileset dir="\\pcaw2d1\wwwroot$\terminology" 
		defaultexcludes="false">

		<include name="**" />
		<exclude name="Logs" />

		<!-- Do not delete the actual folder -->
		<exclude name="." />

		
	</fileset>
</delete>
-- CUT AGAIN

How should I do this?

Michael Fletcher
Petro-Canada
 
--------------------------------------------------------

This email communication is intended as a private communication for the sole use of the primary addressee and those individuals listed for copies in the original message. The information contained in this email is private and confidential and If you are not an intended recipient you are hereby notified that copying, forwarding or other dissemination or distribution of this communication by any means is prohibited.  If you are not specifically authorized to receive this email and if you believe that you received it in error please notify the original sender immediately.  We honour similar requests relating to the privacy of email communications.
 
Cette communication par courrier electronique est une communication privee a l'usage exclusif du destinataire principal ainsi que des personnes dont les noms figurent en copie.  Les renseignements contenus dans ce courriel sont confidentiels et si vous n'etes pas le destinataire prevu, vous etes avise, par les presentes que toute reproduction, transfert ou autre forme de diffusion de cette communication par quelque moyen que ce soit est interdite.  Si vous n'etes pas specifiquement autorise a recevoir ce courriel ou si vous croyez l'avoir recu par erreur, veuillez en aviser l'expediteur original immediatement.  Nous respectons les demandes similaires qui touchent la confidentialite des communications par courrier electronique.

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


Re: Removing only the Children of a folder

Posted by Jeffrey E Care <ca...@us.ibm.com>.
Just a helpful tip: the gurus on this list who hang out to help the newbs 
usually find it really annoying when people post the same question twice 
in one day. Please allow at least 48 hours before posting your question 
again.

____________________________________________________________________________________________ 

Jeffrey E. (Jeff) Care 
carej@us.ibm.com 
IBM WebSphere Application Server Development 
WAS Pyxis Lead Release Engineer 




"Fletcher, Michael \(Calgary\)" <MF...@petro-canada.ca> wrote on 
03/27/2006 11:52:49 AM:

> Hello
> 
> I am trying to remove almost all of the files in a folder except for the
> "Logs" folder and the folder itself.  Unfortunately if the folder
> doesn't contain any Logs then the whole folder is removed.
> 
> This is a snippet of my build.xml.
> 
> -- CUT
> <delete verbose="true" includeemptydirs="true">
>    <fileset dir="\\pcaw2d1\wwwroot$\terminology" 
>       defaultexcludes="false">
> 
>       <include name="**" />
>       <exclude name="Logs" />
> 
>       <!-- Do not delete the actual folder -->
>       <exclude name="." />
> 
> 
>    </fileset>
> </delete>
> -- CUT AGAIN
> 
> How should I do this?
> 
> Michael Fletcher
> Petro-Canada
> 
> --------------------------------------------------------
> 
> This email communication is intended as a private communication for 
> the sole use of the primary addressee and those individuals listed 
> for copies in the original message. The information contained in 
> this email is private and confidential and If you are not an 
> intended recipient you are hereby notified that copying, forwarding 
> or other dissemination or distribution of this communication by any 
> means is prohibited.  If you are not specifically authorized to 
> receive this email and if you believe that you received it in error 
> please notify the original sender immediately.  We honour similar 
> requests relating to the privacy of email communications.
> 
> Cette communication par courrier electronique est une communication 
> privee a l'usage exclusif du destinataire principal ainsi que des 
> personnes dont les noms figurent en copie.  Les renseignements 
> contenus dans ce courriel sont confidentiels et si vous n'etes pas 
> le destinataire prevu, vous etes avise, par les presentes que toute 
> reproduction, transfert ou autre forme de diffusion de cette 
> communication par quelque moyen que ce soit est interdite.  Si vous 
> n'etes pas specifiquement autorise a recevoir ce courriel ou si vous
> croyez l'avoir recu par erreur, veuillez en aviser l'expediteur 
> original immediatement.  Nous respectons les demandes similaires qui
> touchent la confidentialite des communications par courrier 
electronique.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>