You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jérôme Lacoste <je...@smartcardsystem.com> on 2001/06/13 16:41:18 UTC
Check if a directory exist?
How can I check if a directory exists using Ant?
Jerome
Re: Check if a directory exist?
Posted by Stefan Bodewig <bo...@apache.org>.
Jirtme Lacoste <je...@smartcardsystem.com> wrote:
> How can I check if a directory exists using Ant?
In Ant 1.3 <available> will check for files and directories - in
1.4alpha there is a new type attribute that can be used to only check
for files/directories.
Stefan
RE: Check if a directory exist?
Posted by Jérôme Lacoste <je...@smartcardsystem.com>.
Thanks.
I had seen the available Task, but didn't know a file could be a directory.
Perhaps the definition of what is a file or not should be better defined in
the documentation. In the Java world it is OK, but for some people it might
not be that obvious.
Jerome
Re: Check if a directory exist?
Posted by Erik Hatcher <er...@earthlink.net>.
<available file="c:/dir_name" property="dir.exists"/>
will set a property (to "true", or not) depending on whether the directory
specified in the 'file' attribute of the <available> task is present.
Erik
----- Original Message -----
From: "Jérôme Lacoste" <je...@smartcardsystem.com>
To: "Ant User" <an...@jakarta.apache.org>
Sent: Wednesday, June 13, 2001 7:41 AM
Subject: Check if a directory exist?
> How can I check if a directory exists using Ant?
>
> Jerome