----- Original Message -----
From: "Vincent Massol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 7:40 PM
Subject: Re: <available> problem
> Yes, you're right for the "if" attribute. I was more concerned about the
> <available> task. It shouldn't define the property if the file cannot be
> found, right ? Or am I missing something ...
>
That's true, it doesn't seem to work like expected.
<?xml version="1.0"?>
<project name="test" default="default" basedir=".">
<target name="default">
<available file="" property="yes"/>
<echo message="${yes}"/>
</target>
</project>
results in
Buildfile: build.xml
default:
[echo] true
BUILD SUCCESSFUL.
Unfortunately there does not seem to be a good solution to this problem. The
available-task simply gets handed over file from the "parser" and the parser
constructs these files using the "basedir". First solution would be to pass
a String to available and let it construct the file itself (failing if the
passed filename is the empty string); second solution would be to declare it
correct and don't change it :-)
Nico