ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject RE: Test if directory is empty
Date Wed, 20 Mar 2002 19:57:16 GMT
--- Dominique Devienne <DDevienne@lgc.com> wrote:
> Haven't tried it myself, but from the doc I would say that <pathconvert>
> would have converted your fileset the way you wanted. FWIW, --DD

Yep -- <pathconvert> will turn a fileset into a printable list. And you
could use it, in combination with <condition>, to test for an empty
directory -- eg:

  <fileset dir="foodir" id="fs"/>

  <target name="doit" depends="chkdir" unless="noFiles">
    <echo message="files = ${files}"/>
  </target>

  <target name="chkdir">
    <pathconvert pathsep="," property="files" refid="fs"/>
    <condition property="noFiles">
      <equals arg1="${files}" arg2=""/>
    </condition>
  </target>

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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


Mime
View raw message