ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom.Mo...@expeditors.com
Subject Re: Cannot delete directories using wildcards
Date Fri, 02 Jun 2006 15:38:58 GMT
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: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 

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




<Jan.Materne@rzf.fin-nrw.de> 
06/01/2006 11:20 PM
Please respond to
"Ant Users List" <user@ant.apache.org>


To
<user@ant.apache.org>
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:A.Solofnenko@mdl.com] 
>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.
>
>Tom.Morin@expeditors.com 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: user-unsubscribe@ant.apache.org For 
>additional commands, e-mail: user-help@ant.apache.org
>
>

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



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message