ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject Re: Delete N directories that match a regexp
Date Mon, 07 Sep 2009 14:00:30 GMT
On Mon, Sep 7, 2009 at 6:28 AM, Daniel Steinmann<> 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" />
> 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.

Since one specifies filenames with forward slash only in a build file
(or property files),
and Ant does the right thing to convert them to the current OS, you
can tell <pathconvert>
to use / as the filesep, and use to="\1/**", then <files includes="">
should accept that. --DD

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

View raw message