ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Euan Guttridge <EGuttri...@buildonline.com>
Subject RESOLVED : Test if directory is empty
Date Thu, 21 Mar 2002 16:06:14 GMT
Thanks Diane, Dominique and Stephan. Resolved as below.

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: 20 March 2002 19:57
To: Ant Users List
Subject: RE: Test if directory is empty


--- 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>

--
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