ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Marchesani" <glenl...@model3.net>
Subject deleting a file if it does or does not exist
Date Wed, 15 May 2002 13:08:04 GMT
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message