ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Dyke <will.d...@bbc.co.uk>
Subject RE: How to rename a file
Date Tue, 09 Oct 2001 13:19:34 GMT
I think Dhirendra misses Raj's point - that the jndi jar
file could have any version number. 

The following (adapted from the move example in the manual)
would move jndi_x.y.z.jar to jndi.jar as long as it was the
only file that matched the regular expression (the results
are indeterminate if e.g. jndi_1.3.1.jar and jndi_1.2.1.jar
exist in the same directory) 

  <move todir="my/jndi/dir">
    <fileset dir="my/jndi/dir"/>
    <mapper type="regexp" from="^jndi(.*)\.jar$$" to="jndi.jar"/>
  </move>

I haven't tested the above code, but it should be close enough
to experiment with and debug. 

Will Dyke

> -----Original Message-----
> From: Dhirendra Kulkarni [mailto:dkulkarni@ptc.com]
> Sent: 09 October 2001 07:08
> To: ant-user@jakarta.apache.org
> Subject: Re: How to rename a file 
> 
> 
> I think move task exactly does this
> for  e.g : <move file="jndi_1.2.1.jar" tofile="jndi.jar"/>
> 
> ----- Original Message -----
> From: Raj Kumar <kothapa@intalio.com>
> To: <ant-user@jakarta.apache.org>
> Sent: Tuesday, October 09, 2001 3:38 AM
> Subject: How to rename a file
> 
> 
> > hi,
> >   I have a jar file name for the form jndi_1.2.1.jar and i  
> need to rename
> > it to one without the version number.
> >   i.e the new name of the file should be jndi.jar.   Can 
> somebody please
> > help me with this.The version number could be anything.
> >       thanks,
> >       rajkumar
> >
> >
> 


This e-mail, and any attachment, is confidential. If you have received
it in error, please delete it from your system, do not use or disclose
the information in any way, and notify me immediately. The contents of
this message may contain personal views which are not the views of the
BBC, unless specifically stated.


Mime
View raw message