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:51:44 GMT
Hmmm...  you are right.  After looking, the problem was trying to delete a
jar file that was in the ant class path thus it could not be deleted (though
I remember that this is jvm dependent).  Cleaning up my classpath and delete
behaves as expected.

thanks,
Glen


----- Original Message -----
From: "Stefan Bodewig" <bodewig@apache.org>
To: <ant-user@jakarta.apache.org>
Sent: Wednesday, May 15, 2002 3:30 PM
Subject: Re: deleting a file if it does or does not exist


> On Wed, 15 May 2002, Glen Marchesani <glenlist@model3.net> wrote:
>
> >   <delete file="generated.jar"/>
> >
> > This only works if the file does exist if it doesn't I get an error
>
> Hmm, works for me
>
> [bodewig@bodewig tmp]$ cat b.xml
> <project default="b">
>   <target name="b">
>     <delete file="not-there" />
>   </target>
> </project>
>
> [bodewig@bodewig tmp]$ ant -f b.xml
> Buildfile: b.xml
>
> b:
>
> BUILD SUCCESSFUL
> Total time: 1 second
>
> and with -verbose
>
> b:
>    [delete] Could not find file /tmp/not-there to delete.
>
> BUILD SUCCESSFUL
>
> > "D:\foo\build.xml:295: Unable to delete file D:\foo\generated.jar"
>
> This is the message you will get if the file exists but cannot be
> deleted.
>
> Stefan
>
> --
> 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