ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: <available> problem
Date Wed, 21 Mar 2001 18:06:26 GMT

----- Original Message -----
From: "Stefan Bodewig" <>
To: <>
Sent: Wednesday, March 21, 2001 02:46
Subject: Re: <available> problem

> Vincent Massol <> wrote:
> > 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 ...
> I know that, just "" _is_ the basedir, sorry.
> > 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.
> Having file and dir only makes sense if we not only test the existance
> of a filesystem object, but also whether it is of the given type. If
> we introduce this change, we are sure going to break older builds, so
> it cannot happen in Ant 1.x.

I was thinking that a 'fileonly=<file>' attribute could check for exists
(file) && !directory(file), a 'dir=<file>' checks for exists(dir) &&
directory(file). Of course the immediate feature creep then becomes to check
for access permissions with conditions like readable='true' and


View raw message