Rather than using *.* use * ... that will match any filename with or
without an extension.

I guess I don't understand why you can just exclude your config file
names. If they are in a directory the directory won't be deleted.

BOb



> -----Original Message-----
> From: Parrish, Ken [mailto:kparr...@gomez.com]
> Sent: Tuesday, January 06, 2009 2:35 PM
> To: Brass Tilde; nant-users@lists.sourceforge.net
> Subject: Re: [NAnt-users] Delete files but preserve directory tree
> 
> Nant Users,
> 
> Thanks for your feedback on this.  I've replied to this list a couple
of
> time, but my posting keep getting bounced.
> 
> The addition of a filesOnly and/or directoriesOnly attribute to a
> <fileset> would greatly simplify file operations which need to be
> applied to one or the other, yet still allow for the power and
> flexibility of the <fileset> element.
> 
> Below it what I devised.  It works well except that the *.* file
filter
> excludes files that might not have an extension.  Not a huge problem
in
> the Windows world that I employ, but still a limitation.
> 
> However, the filesOnly parameter to the <fileset> as described above
> would likely allow this task to reduce to a single <delete> element.
> 
> Thanks,
> 
> Ken Parrish
> Gomez, Inc.
> 
>       <!--
>               PurgeDirectory
>                       Recursively removes file from a directory tree
> preserving the directory tree.
> 
>               Parameters:
>                       PurgeDirectory_dir                      path
> name of directory to purge
>       -->
>       <target name="PurgeDirectory" >
> 
>           <echo message="PurgeDirectory = ${PurgeDirectory_dir}" />
> 
>               <delete>
>                       <fileset basedir="${PurgeDirectory_dir}">
>                               <include name="*.*" />
> 
>                               <!-- Add exclusions here -->
>                       </fileset>
>               </delete>
> 
>               <foreach item="Folder" in="${PurgeDirectory_dir}"
> property="dirname">
>                       <property name="PurgeDirectory_dir"
> value="${dirname}" />
>                       <call target="PurgeDirectory" />
>               </foreach>
>       </target>
> 
> 
> 
> 
> -----Original Message-----
> From: Brass Tilde [mailto:brassti...@gmail.com]
> Sent: Tuesday, January 06, 2009 11:24 AM
> To: nant-users@lists.sourceforge.net
> Subject: Re: [NAnt-users] Delete files but preserve directory tree
> 
> > IF this a consistent directory tree? If so, just exclude the
> directories
> > from the delete. If not I think you should be able to use a foreach
to
> loop
> > over a fileset and delete each individual files. But, I don't know
how
> good
> > the performance on this will be.
> 
> Would the effort of adding a "filesOnly" attribute to the fileset
> object be worth the time and effort?
> 
> Brad
> 
>
------------------------------------------------------------------------
> ------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> NAnt-users mailing list
> NAnt-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nant-users
> 
>
------------------------------------------------------------------------
--
> ----
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> NAnt-users mailing list
> NAnt-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nant-users

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to