ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Suggested change to to check failonerror flag when unable to delete source file as part of move
Date Tue, 29 Mar 2005 16:20:37 GMT

I have some ant scripts that manage archiving files between NT servers in
our production environment.  A while back the move task began failing with
an error related to deleting the source file (see below)

     [move] Warning: Unable to delete file \\server\foo\bar.log

Under ant 162 when this happens the move task stops processing the list of
files to move  - but the ant script does not fail.

I have the move task configured with failonerror=false - but looking at the
code it seems that this parameter is not honored by the move class.   I
made a couple of changes locally to have the move class check this flag and
conditionally issue a warning as opposed to an abort - and was wondering if
these changes could get committed into the base code.

Here are the changes:


<              boolean failOnError = getFailOnError();
<                String message = "Unable to delete "
>                 throw new BuildException("Unable to delete "
<                                         + fromFile.getAbsolutePath()
<                                       + " FailOnError is "+failOnError;
<               if (failOnError) {
<                       throw new BuildException(message);
<               } else {
<                         log(message);
<               }
>                                         + fromFile.getAbsolutePath());  (added accessor to the failonerror flag)

<     public boolean getFailOnError() {
<         return failonerror;
<     }

If these changes need to be sent to the developers list - let me know and I
can send them there.


Gary Bartlett

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message