ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: available does not support *
Date Wed, 06 Sep 2006 08:43:04 GMT

there's also another solution with antcontrib <if>, something like =

<fileset dir="T:/test" includes="*.ear" id="ear.files" />
      
     <if>
        <equals arg1="${toString:ear.files}" arg2=""/>
         <then>
            <echo>No files !!</echo>
         </then>
         <else>
            <echo>Files in fileset =
${line.separator}${toString:ear.files}</echo>
         </else>
     </if>


i know the use of ${toString: ... } is not recommended, but i use i
quite often

Regards, Gilbert
 

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Wednesday, September 06, 2006 6:07 AM
To: user@ant.apache.org
Subject: Re: available does not support *

On Tue, 05 Sep 2006, Dirk Starke <dirk@starke-net.de> wrote:

> I would like to test whether or not a specified directory contains
> some files.

Apart from Jan's suggestion, which should work for Ant 1.6, Ant
1.7beta comes with a new <resourcecount> condition

<condition property="dir-is-not-empty?">
  <resourcecount when="greater" length="0">
    <fileset dir="..."/>
  </resourcecount>
</condition>

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message