I updated the Delete task with the proposed behaviour :

- A BuildException is no longer thrown when you try to delete a file or
directory that doesn't exist
- A "quiet" attribute was added to the task :

If the specified file or directory does not exist, do not display a
diagnostic message or modify the exit status to reflect an error. When set
to "true", if a file or directory cannot be deleted, no error is reported.
Default is "false". Setting this to "true" implies setting failonerror to
"false".

So what this means is :

A message will still be logged with the default behaviour, only if you set
quiet to true (and the project is not run in verbose mode) no message will
be written to the log.

I also updated the NUNIT DeleteTest testfixture.

I anyone still has its doubts, then have a look at the static Delete method
on the System.IO.File class :

"Deletes the specified file. An exception is not thrown if the specified
file does not exist.".


While updating the DeleteTask class, I noticed the following code in the
source :

// TODO: remove this once this task is fully tested and NAnt is at 1.0
if (path.Length <= 10) {
throw new NotImplementedException("Path is too close to root to delete.");
}

This means that any directory with 10 characters or less in its full path
would never be removed, shouldn't we remove this ??

Ian, can you commit this if everyone agrees ?

Thanks,

Gert

Attachment: DeleteTask.diff
Description: Binary data

Attachment: DeleteTest.diff
Description: Binary data

Reply via email to