ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Test if directory is empty
Date Wed, 20 Mar 2002 15:20:30 GMT
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

 -----Original Message-----
From: 	stephan beal [mailto:stephan@einsurance.de] 
Sent:	Wednesday, March 20, 2002 5:31 AM
To:	ant-user@jakarta.apache.org
Subject:	Re: Test if directory is empty

On Wednesday 20 March 2002 11:51 am, Euan Guttridge wrote:
> I would like to be able to test if a directory is empty, and if it is not
> empty then perform a task. Any suggestions appreciated.

What i did was write a task which gives me the list of files in a directory 
as a string. If the string is empty, the dir is empty. Email me if you'd
like 
that task. i wrote a custom task for that because when i tried to print 
filesets i got a string which looked like a reference address (not a
readable 
string, anyway).

The xml looks like this:

<taskdef name="filelister" classname="de.einsurance.ant.FileListTask"/>
<filelister
  outputproperty='build.cvs.maillist' includedirs="false" 
  delimiter=" " dir="${build.cvs.maildir}"
  usefullpaths="true"
/>
<condition property="cvs.doupdates">
  <!-- Set cvs.doupdates if the list of files in ${build.cvs.maildir} is not

empty. -->
 <not>
    <equals arg1="" arg2="${build.cvs.maillist}"/>
  </not>
</condition>


----- stephan
Generic Universal Computer Guy
stephan@einsurance.de - http://www.einsurance.de
Office: +49 (89)  552 92 862 Handy:  +49 (179) 211 97 67
"I ain't gen'rally given to physicality of that nature but it saves
a lot of arguing." -- Nanny Ogg

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