ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ondřej Světlík <ond...@svetlik.info>
Subject Re: test for directory existence
Date Wed, 15 Feb 2006 15:31:48 GMT
> Good Morning All-
>
> How do you test for the existence of a folder before del or mkdir
> operation
> Has something to with <property ???
>
> Thanks!
>
> Martin Gainty
>
> (mobile) 603-438-5053
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

Hello,

why do you want to check for it's existence? Both tasks (<delete> and
<mkdir>) can handle non-existing respectively existing directories. See
this example:


<project name="delete" default="all">

<target name="all">
        <mkdir dir="dir/dir2" />
        <mkdir dir="dir/dir2" />
        <delete dir="dir" />
        <delete dir="dir" />
</target>

</project>

It will successfully pass. The second <mkdir> won't do anything with the
original content of the folder.

Best regards

Ondrej Svetlik

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


Mime
View raw message