Hi Gerry,
responses inline
----- Original Message -----
From: "Gerry Shaw" <[EMAIL PROTECTED]>
To: "Gert Driesen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 19, 2003 5:39 PM
Subject: Re: [nant-dev] Delete task behaviour
> What happens if you have directory foo that you want to delete and you
> enter:
>
> <delete dir="f00"/>>
>
> The delete task will not raise an error and your directory foo will not
> exist.
That's true, but ask yourself this question : If I don't want to be married
and I'm not actually married, would I still want a divorce or would I just
be happy because I'm not married anyway ...
>
> In my private branch of nant that I'm working on I use functions in
> properties so that I can write:
>
> <delete dir="foo" if="${DirectoryExists('foo')}"/>
So what you're trying to do is : delete the directory if it doesn't exit,
right ?
Well, I'm actually proposing a change that will make your DirectoryExists
function obsolete in this case (it's still useful for other things of
course, although I thing NAnt should have a task for checking if files or
directories exist)
> (See attached file: test.Xml)
> Apache Ant fails on default.�� The provide a quiet switch which
> suppresses the error message and sets failonerror to be true.
Apache Ant certainly does not fail by default !!!!!
I've include a sample buildfile which delete the directory C:\TEST. IF it
doesn't exist, it won't cause any error, for sure !!
The Ant delete task throws an error when a directory or file can't be
deleted, not when it doesn't exist at all. When a file or directory can't
be deleted, you suppress the error message from being displayed in the
logger by setting quiet="true". You would wantto do this when you want to
clear temporary files or so, and you don't want to be bother with a error
message in your log file when some files are still in use or so ...
>
> I vote no to the change.
I definitely vote yes ....
>
> On Tuesday, February 18, 2003, at 11:33� PM, Gert Driesen wrote:
>
> > Hi,
> >
> > In my opinion the current behaviour of the delete task is not valid..
> >
> > It current throws an exception (which causes the build to fail if
> > failonerror=true) when the file or directory that you want to delete
> > doesn't
> > exist.
> >
> > If you want to delete a directory or file that doesn't exist, then this
> > should just be considered a successful execution of the task,
> > shouldn't it
> > be ?
> >
> > Certainly if there's currently no means to check if a directory (or
> > file)
> > actually exists.
> >
> > Does everyone agree to change this behaviour ?
> >
> > Is it ok if I submit a patch to you, Ian ?
> >
> > Thanks,
> >
> > Gert
> >
> >
> >
> > -------------------------------------------------------
> > 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
>
The Information contained in this message is intended for the addressee
only and may contain confidential information. Any views or opinions
presented are solely those of the author and do not necessarily represent
those of Ardatis. Ardatis reserves the right to monitor the content of all
e-mail messages it receives.
test.Xml
Description: Binary data
