On Tue, 24 Jun 2008, Andrew Clegg <[EMAIL PROTECTED]> wrote:

> I have just had a couple of thoughts which I'll post here for the
> benefit of others who might be in a similar situation.
> 
> I think my original problem is because each of the subdirectories in
> the autosrc tree contains an ignored .svn directory, meaning that
> none of them are ever completely empty, so they don't get removed.
> 
> Perhaps this also explains why
> 
>                <delete verbose="true" includeemptydirs="true">
>                        <fileset dir="autosrc"/>
>                </delete>
> 
> leaves the autosrc directory, when the manual suggests it should
> remove it. There's still a .svn file in there which protects it from
> deletion.

I think you are correct.

> However there is perhaps a small inconsistency in the fact that Ant
> ignores .svn directories (and various others) when deciding what to
> delete, but doesn't ignore them when deciding if a directory is
> empty.

In most cases Ant's behavior probably is exactly what is intended by
many people.  You don't want to lose your real work when removing
backups recursively (deleting the directories that don't contain any
backups because no file matched the include pattern).

When deciding whether a directory is empty, Ant asks the OS and
doesn't only consult its internal list of files that matched the
include pattern(s).

I'll update the manual.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to