Hi Gerry,

I agree with you that adding an attribute like 'ignore_failures' should definitely 
avoided.

Please have a look at my updates to the DeleteTask that I sent earlier today.

These updates correspond with how Ant currently works, and no, I'm not saying that we 
should do everything exactly like Ant does, but in this case the Ant approach is 
correct: deleting a file or directory that doesn't exist, can never caused a 
BuildException, regardless of the FailOnError attribute.

By default, a message will be logged when you try to delete a file or directory that 
doesn't exist.  But it won't ever cause the build to fail.

I also added an attribute that allows you to specify whether you want any error 
messages to be logged at all when files or directories can't be deleted.  I take no 
credits for this, I borrowed this idea from using Ant.  This is very useful if you 
want to clean up temporary files in your build script, but you don't acutally care if 
the clean-up succeeds or not and you want to be bothered over and over again when 
files can't be deleted.

What some are actually asking for is a task that allows you to check if a file or 
directory exists.  This is not something that the Delete task is meant for.  The 
Delete task should just make sure that the directory or file(s) you specify does no 
longer exists if the task is executed successfull, that's all .. no more, no less ... 
I'll look into creating a task for checking if a file or directory exists in the next 
few days.  We should probable creating something similar to the Ant Available task 
.(http://ant.apache.org/manual/CoreTasks/available.html).

Gert



------------------------
 Gerry Shaw <[EMAIL PROTECTED]> wrote:
------------------------
        
>On Wednesday, February 19, 2003, at 10:17  AM, 
>[EMAIL PROTECTED] wrote:
>
>> Gerry:
>>> 
>>> The delete task will not raise an error and your directory foo will 
>>> not
>>> exist.
>>
>> I liked the feature that Gert suggested, but I see Gerry's point. What
>> about this:
>>
>> Add an attribute, say "ignore_failures" (name open to suggestions!) 
>> that
>> toggles the behavior described:
>
>And how would this differ from setting failonerror to "false"?
>
>For example,
>
>
>
>
>I do see the point of it being a bit ugly when what you want to write a 
>clean target and just delete a build folder but at the same time if the 
> task by default ignored errors there would be no way to 
>trigger a failure if that IS what the user wanted without adding a new 
>attribute.
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
>The most comprehensive and flexible code editor you can use.
>Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
>www.slickedit.com/sourceforge
>_______________________________________________
>Nant-developers mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/nant-developers
>




-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to