ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Marchesani" <>
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.
       <fileset dir="." includes="**/generated.jar.*"/>

I am looking to learn of better ways to do the file deletion if it exists and not fail if
it doesn't.


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