ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Kramer <Douglas.Kra...@Sun.COM>
Subject Ant: create file if none exists
Date Sat, 29 Jan 2005 23:54:22 GMT
Okay, try again.

Need to create a file (actually a symlink) if none exists.

Is there a way to set a property true if a resource does *not* exist?

DETAIL --------------------------------------------

The dosomething task will do something only if the file

   <target name="test">
       <available file="${MYFILE}" property="file.exists" value="true" />

   <target name="dosomething" depends="test" if="file.exists">
       <echo message="Do something here">

I tried using <not>, but it won't work, because the "not"
operation of "is not set" is not true.

   <target name="test">
       <condition property="file.notexists">
              <available file="${MYFILE}" property="file.exists" value="true" />

Ideas?  I don't see a NotAvailable task.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message