ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject RE: delete dir with wilcard
Date Fri, 06 Aug 2004 01:52:24 GMT
Thanks for pointing that out.  Looks like the problem was using "**/**" 
rather than "**/*" that you used.  Makes me wonder how I didn't try that?

Jake

At 09:19 AM 8/5/2004 -0400, you wrote:
>Hey,
>
>         I have tried the following piece of code and it did a good result
>
>     <property name="parentDir" location="/path/to/your/location"/>
>     <target name="dropDirs" >
>         <delete includeEmptyDirs="true">
>             <fileset dir="${parentDir}">
>                 <include name="**/*"/>
>             </fileset>
>         </delete>
>     </target>
>
>With a file structure like:
>- root
>    |- dir
>       |- subdir1
>       |- subdir2
>          |- file21
>          |- file22
>          |- file23
>          |- file24
>       |- subdir3
>          |- file31
>          |- file32
>
>         And knowing just the name of the parent (in this case ${parentDir})
>I executed it and drop the contents (including the directories under
>${parentDir}), but leave the ${parentDir} in the filesystem.
>
>         HTH
>         Luis
>
>
>-----Original Message-----
>From: Perkins, Kristian [mailto:Kristian.Perkins@ato.gov.au]
>Sent: Thursday, August 05, 2004 12:14 AM
>To: Ant Users List
>Subject: RE: delete dir with wilcard
>
>
>http://ant.apache.org/manual/CoreTasks/delete.html states that it :
>"Deletes ... a specified directory and all of its files and
>subdirectories ...".  I would suggest that a fileset always includes the
>directory specified by the dir attribute.  How about a workaround of
><mkdir dir="${targetdir}"/> straight after the delete, other than that ?
>
>Kristian
>
>
>
>-----Original Message-----
>From: Jacob Kjome [mailto:hoju@visi.com]
>Sent: Thursday, 5 August 2004 2:29 PM
>To: Ant Users List
>Subject: RE: delete dir with wilcard
>
>
>Related to this, does anyone know how I can delete everything in a
>directory, but not the directory itself?  For instance, the following is
>
>equivalent to <delete dir="${targetdir}"/>....
>
>          <delete includeEmptyDirs="true" quiet="true">
>              <fileset dir="${targetdir}" defaultExcludes="false"
>includes="**/**"/>
>          </delete>
>
>But what I'm trying to say is delete everything inside ${targetdir}, not
>
>${targetdir} itself.  I could do the following, but it only works if the
>
>directory is not empty already and it skips deletion of all directories
>and
>files immediately in the current directory if ${targetdir} isn't empty.
>
>          <delete includeEmptyDirs="true">
>              <fileset dir="${targetdir}" defaultExcludes="false"
>includes="**/**" excludes="*" />
>          </delete>
>
>I've got to be missing something obvious.  Anyone?
>
>Jake
>
>At 11:11 AM 8/5/2004 +1000, you wrote:
> >Try using <delete> with a <fileset>
> >
> >Kristian
> >
> >-----Original Message-----
> >From: Paul Wallace [mailto:paulw@isell.com.au]
> >Sent: Thursday, 5 August 2004 11:03 AM
> >To: Ant Users List
> >Subject: delete dir with wilcard
> >
> >
> >Hi,
> >          Having read the fine manual (fully?), I am still at a loss
> >for a solution to my problem. I want to delete a directory (and all its
>
> >contents (files/sub dirs etc)), but I do not know the name of it, all I
>
> >do know, is the path to its parent directory, and the begining of the
> >directory name - hence the wilcard query. My directory will always be
> >called jar....something. How can I remove it using Ant, with a wildcard
>
> >(or by any means). E.g:
> >
> >c:\mydir\jar-1.7.0\myFile.jar
> >
> >how can I do something like:
> >
> >delete c:\mydir\jar*
> >
> >in an Ant expression please?
> >
> >thanks alot
> >
> >Paul.
> >
> >
> >****************************************************************
> >                             IMPORTANT
> >
> >  The information transmitted is for the use of the intended recipient
> > only and may contain confidential and/or legally privileged material.
>Any
> > review, re-transmission, disclosure dissemination or other use of, or
> > taking of any action in reliance upon, this information by persons or
> > entities other than the intended recipient is prohibited and may
>result
> > in severe penalties.  If you have received this e-mail in error please
>
> > notify the Privacy Hotline of the Australian Taxation Office,
>telephone
> > 13 28 69 and delete all copies of this transmission together with any
> > attachments.
> >****************************************************************
> >
> >
> >---------------------------------------------------------------------
> >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
>
>
>
>****************************************************************
>                             IMPORTANT
>
>  The information transmitted is for the use of the intended recipient only
>and may contain confidential and/or legally privileged material. Any review,
>re-transmission, disclosure dissemination or other use of, or taking of any
>action in reliance upon, this information by persons or entities other than
>the intended recipient is prohibited and may result in severe penalties.  If
>you have received this e-mail in error please notify the Privacy Hotline of
>the Australian Taxation Office, telephone 13 28 69 and delete all copies of
>this transmission together with any attachments.
>****************************************************************
>
>
>---------------------------------------------------------------------
>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


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


Mime
View raw message