ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
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 [] 
Sent:	Wednesday, March 20, 2002 5:31 AM
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
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
string, anyway).

The xml looks like this:

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

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

----- stephan
Generic Universal Computer Guy -
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:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message