You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jakob Ramskov <co...@ramosa.com> on 2000/06/16 21:59:40 UTC

deprecate deltree ?

How come, with the new <delete dir= .. that <deltree> is not deprecated? You can do exactly the same with both..

- Ramosa

RE: deprecate deltree ?

Posted by Conor MacNeill <co...@m64.com>.
Ramosa,

We have actually discussed this in the past. Arnout made a suggestion about
rationalising the whole move/delete/copy operations. I have appended the
resulting discussion below. The direction is clear - we should
deprecate/remove deltree and extend delete to cover the deletion of a
directory tree.

Here is our previous discussion:
> > One question, will you retain deltree? If not, how do you distinguish
> > between deleting the contents of the directory and deleting
> > the directory
> > AND its contents?
>
> deltree should not be retained because of duplication. The new delete
> task also covers the current deltree funtionality (see case 1 below).
>
> The proposal for the new delete task includes the functionality of
> the current deltree and delete tasks, and extends it with recursing
> through a directory, to be able to remove only files that match a
> pattern. This way, the basic file operations (copy, delete, and move)
> work more or less the same.
>
>
> We can distinguish between the two cases mentioned before:
>
> <delete dir="somedirectory"/>
>
> without includes and excludes will delete the directory AND contents
> (makes sense, if you want to delete the directory, you want to include
> all its content).
>
> <delete dir="somedirectory" includes="..." excludes="..."/>
>
> (thus with includes and/or excludes) will delete the contents of the
> directory, but not the directory itself (makes also sense, if you want
> to include and exclude files from deleting, you don't want the
> directory itself to be removed).
>
> To the last case, an attribute can be added to allow the directory to
> be deleted when it is empty (e.g. deletewhenempty="true"). But I think
> that this will not be used very often.
>
> Cheers,
>
>   Arnout
>

--
Conor MacNeill
Home: conor@m64.com
Work: conor@cortexebusiness.com.au
Web:  www.cortexebusiness.com.au




Re: deprecate deltree ?

Posted by Jakob Ramskov <co...@ramosa.com>.
> ><delete dir="xyz" />
> >
> >will not delete the directory, it will just fail to match any files and
do
> >nothing.
> >
> >Also, with delete, if the dir doesn't exist a BuildException is thrown.
> >With deltree there is no exception.
> >
> >BTW, thanks Tom (& Sam for committing it) for this patch.  No more
whining
> >from me!
>
> You're very welcome!
>
> There is actually a pretty significant difference.  <delete dir="myDir"
> includes="**/*" /> will delete all of the files in a big directory tree,
> but leave all of the directories and any files matched by the
> <defaultexcludes> intact, while <deltree dir="myDir"> will delete all
files
> and all directories.

All of the above should be documented..

I still think that the existance of two ways to delete a dir is generally
confusing.

-Ramosa


RE: deprecate deltree ?

Posted by Tom Dimock <ta...@cornell.edu>.
At 01:13 PM 6/16/00 -0700, you wrote:
>Not quite.
>
><delete dir="xyz" />
>
>will not delete the directory, it will just fail to match any files and do
>nothing.
>
>Also, with delete, if the dir doesn't exist a BuildException is thrown.
>With deltree there is no exception.
>
>BTW, thanks Tom (& Sam for committing it) for this patch.  No more whining
>from me!

You're very welcome!

There is actually a pretty significant difference.  <delete dir="myDir"
includes="**/*" /> will delete all of the files in a big directory tree,
but leave all of the directories and any files matched by the
<defaultexcludes> intact, while <deltree dir="myDir"> will delete all files
and all directories.

RE: deprecate deltree ?

Posted by Jason Sando <js...@think1up.com>.
Not quite.

<delete dir="xyz" />

will not delete the directory, it will just fail to match any files and do
nothing.

Also, with delete, if the dir doesn't exist a BuildException is thrown.
With deltree there is no exception.

BTW, thanks Tom (& Sam for committing it) for this patch.  No more whining
from me!

-j

-----Original Message-----
From: Jakob Ramskov [mailto:contact@ramosa.com]
Sent: Friday, June 16, 2000 1:00 PM
To: ant-dev@jakarta.apache.org
Subject: deprecate deltree ?


How come, with the new <delete dir= .. that <deltree> is not deprecated? You
can do exactly the same with both..

- Ramosa