Joe,
 
What you want to do is this:
 
<if test="${not file::exists( file.to.check )}">
 
HTH,
Felice
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Joe Uchytil
Sent: Tuesday, February 22, 2005 7:58 AM
To: [email protected]
Subject: [Nant-users] file::exists() problem

How do I use the <IF> task to check for the existence of a file where the file name is stored in a property?

 

The documentation shows

<if test=”${not file::exists(‘output.xlm’)}”>

  ...

</if>

 

but trying to do the following does not seem to work.

<property name=’file.to.check’ value=’output.xml’>

<if test=”${not file::exists(‘${file.to.check}’)}”>

</if>

 

It appears that the ${file.to.check} is not expanded but taken literally

 

Any ideas?

 

Joe Uchytil

 

Reply via email to