ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: Delete N directories that match a regexp
Date Tue, 08 Sep 2009 19:01:09 GMT
On Mon, Sep 7, 2009 at 13:28, Daniel Steinmann<dsteinmann@acm.org> wrote:
>
>
> Matt Benson wrote:
>>
>>
>> (given same dirset id=ds)
>>   <pathconvert refid="ds" property="includes" pathsep="${line.separator}">
>>     <regexpmapper from="(^.*$)" to="\1${file.separator}**" />
>>   </pathconvert>
>>   <echo file="includesfile">${includes}</echo>
>>   <delete>
>>     <files includesfile="includesfile" />
>>   </delete>
>>   <delete file="includesfile" />
>>
>>
>
> Great tip!
>
> But I have problems with the to= part of the regex pattern on Windows. The
> file.separator on Windows is the backslash, which is the escape character
> for the regex. Therefore the file will include patterns like 'foo\bar**'
> instead of 'foo\bar\**'. And then the delete does not work.
>
> Do you have some more magic to make it work on Windows as well?
>

There is WAY more simple:
<regexpmapper from="$" to="${file.separator}**" />

-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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


Mime
View raw message