ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <>
Subject Re: <available> problem
Date Tue, 20 Mar 2001 17:22:08 GMT

----- Original Message -----
From: "Stefan Bodewig" <>
To: <>
Sent: Tuesday, March 20, 2001 8:31 AM
Subject: Re: <available> problem

> Vincent Massol <> wrote:
> > I was more concerned about the <available> task. It shouldn't define
> > the property if the file cannot be found, right?
> but it doesn't 8-)
> file="" means "" relative to the project's basedir, which in turn
> means the basedir itself - which exists.  If you really need something
> that fails, "" is the worst of all choices.

Sorry but my requirement is simple : I just want to know if the file exist.
How can I do that in Ant ? If available is not the right task, is there any
other task that will do that ? I don't care whether the basedir directory
does exist or not ...

> To Nico and Steve, I think the current behavior is correct and that we
> shouldn't have different behavior for files and directories.  There
> might even be some build files out there that use file="some-dir" and
> expect it to set the property if that directory exists.


I prefer Steve's idea of having 2 attributes to the available task : 'file'
and 'dir'. File means testing if the file does exist and dir means testing
if the directory exists. At least the meaning is clear and you add the
ability to check whether a file does exist or not.

> Stefan


View raw message