ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: Delete the contents of a directory but not the directory itself
Date Fri, 12 Jan 2007 19:44:24 GMT
--- "Daffin, Miles (IT)"
<Miles.Daffin@morganstanley.com> wrote:

> Don't know how I missed that. It does feel wrong
> somehow. Why should a
> this includes pattern mean that the base directory
> is excluded? I don't
> see how one could deduce this behaviour. Can you?

It's a matter of knowing that Ant includes the base
directory of a fileset when doing the scan.  For most
tasks it's irrelevant because a fileset semantically
means a group of files only.  Explicitly saying
includes="**/*" literally means only any file or
directory below the basedir of the fileset.  Note that
we welcome any suggestions regarding where in the
manual you might have hoped to find this file
scanning information.

-Matt
> 
> Thanks all.  
> 
> Miles
> 
> > -----Original Message-----
> > From: Peter Reilly
> [mailto:peter.kitt.reilly@gmail.com] 
> > Sent: Friday 12 January 2007 19:20
> > To: Ant Users List
> > Subject: Re: Delete the contents of a directory
> but not the 
> > directory itself
> > 
> > It is in the manual for <delete>:
> > 
> >   <delete includeemptydirs="true">
> >     <fileset dir="build" includes="**/*"/>
> >   </delete>
> > 
> > deletes all files and subdirectories of build,
> without build itself.
> > 
> > Peter
> > 
> > On 1/12/07, Matt Benson <gudnabrsam@yahoo.com>
> wrote:
> > >
> > > --- "Daffin, Miles (IT)"
> > > <Miles.Daffin@morganstanley.com> wrote:
> > >
> > > > Dear All,
> > > >
> > > > I want to delete everything in a base
> directory but
> > > > *not* the base dir
> > > > itself. (The base dir *must not be deleted*
> because it is a mount 
> > > > point, not a dir that can be created/deleted
> in a normal
> > > > manner.) If I do this:
> > > >
> > > > <delete verbose="true" >
> > > >   <fileset dir="${install.common.dir}" />
> </delete>
> > > >
> > > > all files are deleted *but* it leaves empty
> dirs behind. 
> > I want the 
> > > > empty dirs gone. However, if I tell delete to 
> > includeemptydirs then 
> > > > the base dir is deleted too!
> > > >
> > > > <delete verbose="true"
> includeemptydirs="true">
> > > >   <fileset dir="${install.common.dir}" />
> </delete>
> > > >
> > > > Is this a bug? If not then how can I do this
> task?
> > >
> > > Have you tried:
> > >
> > > <delete>
> > >   <fileset dir="${install.common.dir}"
> > >            includes="**/*" />
> > > </delete>
> > >
> > > ?
> > >
> > > (this should probably be a F.A.Q.)
> > >
> > > HTH,
> > > Matt
> > > >
> > > > Cordially,
> > > >
> > > > Miles
> > > > ----------------------------------------------
> > > > Miles Daffin
> > > > Morgan Stanley | EAI | MSDE
> > > > 20 Cabot Square | Canary Wharf | London E14
> 4QA | UK
> > > > Tel: +44 (0) 20 767 75119
> > > > Fax: +44 (0) 20 705 64572
> > > > miles.daffin@morganstanley.com
> > > > <mailto:miles.daffin@morganstanley.com>
> > > >
> > >
>
--------------------------------------------------------
> > > >
> > > > NOTICE: If received in error, please destroy
> and notify sender. 
> > > > Sender does not intend to waive
> confidentiality or 
> > privilege. Use of 
> > > > this email is prohibited when received in
> error.
> > > >
> > >
> > >
> > >
> > >
> > > 
> >
>
______________________________________________________________
> > ______________________
> > > Need a quick answer? Get one in minutes from
> people who know.
> > > Ask your question on www.Answers.yahoo.com
> > >
> > > 
> >
>
---------------------------------------------------------------------
> > > 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
> > 
> >
>
--------------------------------------------------------
> 
> NOTICE: If received in error, please destroy and
> notify sender. Sender does not intend to waive
> confidentiality or privilege. Use of this email is
> prohibited when received in error.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



 
____________________________________________________________________________________
Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097

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


Mime
View raw message