By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

delete dir in Nant - error

P: n/a
Sam
This is probably the wrong group to post this in, but I'm not sure
where it should go. If you have suggestions as to another group to
post it let me know.

In our Nant build file for our application. I want to first delete 2
folders if they exist. These folders then later get created. If the
folders exist, I do not get errors, but if they do not, the build
fails.

<delete dir="${build.root}" />
<delete dir="${build.release}" />
>From a Nant website it said that you wouldn't get an error if the
directory didn't exists, but that does seem to be the case for us.

Is there syntax to say: If exist...delete? I'm new to Nant and just
trying to maintain something someone else wrote and has now left the
company.

Thanks....

Sep 28 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Sam" <st********@hotmail.comwrote in message
news:11**********************@d55g2000hsg.googlegr oups.com...
This is probably the wrong group to post this in, but I'm not sure
where it should go. If you have suggestions as to another group to
post it let me know.

In our Nant build file for our application. I want to first delete 2
folders if they exist. These folders then later get created. If the
folders exist, I do not get errors, but if they do not, the build
fails.

<delete dir="${build.root}" />
<delete dir="${build.release}" />
>>From a Nant website it said that you wouldn't get an error if the
directory didn't exists, but that does seem to be the case for us.

Is there syntax to say: If exist...delete? I'm new to Nant and just
trying to maintain something someone else wrote and has now left the
company.

Thanks....
<delete if="${directory::exists(build.root)}" dir="${build.root}" />

and for files...

<delete if="${file::exists(filename)}" file="${filename}"/>

Tigger
Sep 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.