ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: test for directory existence
Date Wed, 15 Feb 2006 15:38:45 GMT
*Not sure about delete*
 but I know
mkdir will fail if the folder is already in place
Thus the reason for checking the folder existence before mkdir operation

díky!
Martin-
----- Original Message ----- 
From: "Ondřej Světlík" <ondrej@svetlik.info>
To: "Ant Users List" <user@ant.apache.org>
Sent: Wednesday, February 15, 2006 10:31 AM
Subject: Re: test for directory existence


>> 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