On Thu, Dec 07, 2000 at 02:15:53PM +0100, Stefan Bodewig wrote:
> Raphael PIERQUIN <[EMAIL PROTECTED]> wrote:
> 
> > If I need to rename every file *.toto into *.tata,
> > I would intuitivly use a move task a follow :
> > <my-example>
> >     <move todir="mydir">
> >            <fileset dir="mydir"/>
> >            <mapper type="regexp" from="(.*)\.toto" to="\1\.tata" />
> >     </move>
> > </my-example>
> > 
> > ant will throw a NullPointerException if the move task meets a file
> > that does not end in '.toto'
> 
> Yes, this was a bug. The intended behavior is to copy nothing. The
> problem arises when the overwrite attribute has been set to true,
> which is the default for <move>.
> 
> Fixed a few seconds ago, thanks.

thanks for beeing so quick.

> 
> Stefan
> 
> BTW, I'd use a glob mapper in a simple case like this, which is easier
> to read and more efficient at the same time.
> 

Actually I met this bug with another kind of rename operation, which
requires a regex mapper :

<what-i-actually-want-to-do>
        <mapper type="regexp" from="(.*)@toto@(.*)" to="\1tata\2" />
</what-i-actually-want-to-do>

You can understand I'm trying to use a kind of 'filter' feature, 
on file name instead of file content. I didn't find any nicer way
to do it, is there one ?

(I need this because I want to generate files structures from
templates of file structure.)  
--
Raphael

Reply via email to