ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rohit P" <rohitmp....@gmail.com>
Subject Re: Under a parent directory delete only 4 out of 6 child directories [non-empty]
Date Tue, 04 Nov 2008 04:42:18 GMT
Thanks for the suggestions.

Actually i would like to delete the child directories by using only once
parent directory. Something similar to deleting set of only .java files
under sub-directories.
Hence i considered task like <fileset>, instead of directly deleting the
child directories one after the other.

If you know or have encountered such situation please let me know how you
resolved it.

Thanks A Ton
Rohit

On Tue, Nov 4, 2008 at 5:34 AM, David Weintraub <qazwart@gmail.com> wrote:

> Have you tried setting the "includeemptydirs" parameter in the delete
> task to true?
>
> That will also delete any directory that is actually empty once the
> files are deleted.
>
> You can also try <dirset> instead of <fileset>.
>
> --
> David Weintraub
> qazwart@gmail.com
>
>
>
> On Mon, Nov 3, 2008 at 6:45 AM, Rohit P <rohitmp.for@gmail.com> wrote:
> > Hi,
> > I have a directory "Parent" containing 6 "child" directories with files.I
> > have a task of deleting only 4 "child" directories with their files.
> > I tried 2 approaches in getting this done. But couldn't accomplish.
> >
> > Approach 1:
> >
> > <project name="Check Deletion task" basedir="." default="main">
> >
> >    <target name="main">
> >        <delete>
> >            <fileset dir="C:\Rootdir\Maindir\Parent" excludes="**\child
> 1\*,
> > **\child 2\*, **\child5\*, **\child6\*"/>
> >        </delete>
> >    </target>
> > </project>
> >
> > Result: This action deleted only the files under the child directories
> >
> > Approach 2:
> >
> > <project name="Check Deletion task" basedir="." default="main">
> >
> >    <target name="main">
> >        <delete>
> >            <fileset dir="C:\Rootdir\Maindir\Parent\child 1"/>
> >            <fileset dir="C:\Rootdir\Maindir\Parent\child 2"/>
> >            <fileset dir="C:\Rootdir\Maindir\Parent\child5"/>
> >            <fileset dir="C:\Rootdir\Maindir\Parent\child6"/>
> >        </delete>
> >    </target>
> > </project>
> >
> > Result: Same as approach 1 deleted all the files under respective child
> > directories.
> >
> > Can anybody suggest me how to delete only 4 child directories and their
> > files?
> >
> > Thanks A Ton
> > Rohit
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message