ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: deleting a file if it does or does not exist
Date Wed, 15 May 2002 13:30:22 GMT
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>


Mime
View raw message