ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Marchesani" <glenl...@model3.net>
Subject Re: deleting a file if it does or does not exist
Date Wed, 15 May 2002 13:24:23 GMT
that is what I was looking for!!!!

thanks,
Glen

----- Original Message -----
From: "Erik Hatcher" <jakarta-ant@ehatchersolutions.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Wednesday, May 15, 2002 3:18 PM
Subject: Re: deleting a file if it does or does not exist


> You could set failonerror="false".
>
>
> ----- Original Message -----
> From: "Glen Marchesani" <glenlist@model3.net>
> To: <ant-user@jakarta.apache.org>
> Sent: Wednesday, May 15, 2002 9:08 AM
> Subject: deleting a file if it does or does not exist
>
>
> Hello I have a newbie question,
>
> I want to delete a file (part of my clean task) but the file isn't
> guaranteed to be there.  I currently use
>
>   <delete file="generated.jar"/>
>
> This only works if the file does exist if it doesn't I get an error
>
> "D:\foo\build.xml:295: Unable to delete file D:\foo\generated.jar"
>
> As a work around I did this.
>
> <delete>
>        <fileset dir="." includes="**/generated.jar.*"/>
> </delete>
>
>
> I am looking to learn of better ways to do the file deletion if it exists
> and not fail if it doesn't.
>
> regards,
> Glen
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message