For the curious, this is it. When calling the run task, a symlink
is created if it does not exist.


<target name="run" depends="makesymlink" /> <echo message="do stuff with symlink" /> </target>

  <target name="makesymlink" depends="jar.symlink.test" 
if="jar.symlink.notexist">
      <symlink link="${WORKDIR}/jar" resource="./build/jar" />
  </target>

  <!-- Set jar.symlink.notexist to true if ${WORKDIR}/jar symlink does not exist 
-->
  <target name="jar.symlink.test">
      <condition property="jar.symlink.notexist">
          <not>
              <available file="${WORKDIR}/jar" property="jar.symlink.exists" />
          </not>
      </condition>
  </target>


Douglas Kramer wrote:
Thanks.  Okay, great so far...

    <available file="${WORKDIR}/jar" property="jar.symlink.exists" />

but I also need to excute a statement if the property is true, something
like this:

if [ -f filename ]; then
   echo "File exists";
fi

-Doug

Erik Hatcher wrote:


On Jan 29, 2005, at 3:40 PM, Douglas Kramer wrote:

Is there a way to test whether a file exists?



<available>

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to