Thanks for the info. One more piece that I was missing in the puzzle was that "test*" only works on files or EMPTY directories. With "test*/" I can now remove all directories no matter if they are empty or not.
>> -----Original Message----- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> This results in AbstractFileSet.getDirectoryScanner(Project) [2]: >> ... >> if (dir == null) { >> throw new BuildException("No directory specified for " + >> getDataTypeName() + "."); >> } >> if (!dir.exists()) { >> throw new BuildException(dir.getAbsolutePath() + " not >> found."); >> } >> if (!dir.isDirectory()) { >> throw new BuildException(dir.getAbsolutePath() + " is >> not a directory."); >> } >> >> What additional exceptions do you want? >None. Based on the initial message I made the (mistaken) assumption that >the user did not receive an appropriate error message. >Cheers, Steve. Ant does report an error: package_clean: [delete] /export/home/tomm/anttest/test* not found. But it was a bit misleading when followed by: #ls -d /export/home/tomm/anttest/test* /export/home/tomm/anttest/test1 /export/home/tomm/anttest/test3 /export/home/tomm/anttest/test2 I just didn't realize ant wasn't expanding the wildcard. -Tom <[EMAIL PROTECTED]> 06/01/2006 11:20 PM Please respond to "Ant Users List" <[email protected]> To <[email protected]> cc Subject AW: Cannot delete directories using wildcards Just for information: - The 'dir' attribute must be exactly one value, because it is the root for all files in that fileset. Therefore wildcards wont work. - The in/exclude clause is relativ to 'dir', so wildcards work. test1 - file 'test1' test1/ - directory 'test1' and its content test* - all beginning with 'test' Jan >-----Ursprüngliche Nachricht----- >Von: Alexey N. Solofnenko [mailto:[EMAIL PROTECTED] >Gesendet: Freitag, 2. Juni 2006 01:25 >An: Ant Users List >Betreff: Re: Cannot delete directories using wildcards > >It should be: > ><delete failonerror="false" includeEmptyDirs="true"> > <fileset dir="${basedir}" includes="test*/"/> </delete> > >- Alexey. > >[EMAIL PROTECTED] wrote: >> I'm probably missing something obvious, but I've been unable >to figure >> out how to delete directories using a wildcard. >> >> So instead of this (test1/2/3 are directories): >> >> <delete failonerror="false" includeEmptyDirs="true"> >> <fileset dir="${basedir}/test1"/> >> <fileset dir="${basedir}/test2"/> >> <fileset dir="${basedir}/test3"/> >> </delete> >> >> I want to do this (which currently does nothing by design): >> >> <delete failonerror="false" includeEmptyDirs="true"> >> <fileset dir="${basedir}/test*"/> >> </delete> >> >> So how can I implement something like the above? >> >> -Tom >> >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] For >additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
