ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <>
Subject Re: Rename directory
Date Tue, 15 Apr 2003 22:22:02 GMT
Basically, you can do this with the move task, using a nested mapper.
Pay attention :
here follows an example which works I have tested under Windows, and should
also work under Unix
NB : I have tested this against ant CVS head

       <!-- add a backslash before the file separator on windows -->
       <condition property="regexp.file.separator"
           <os family="windows"/>
       <!-- properties are immutable, so this will only be set on non
Windows OS -->
       <property name="regexp.file.separator" value="${file.separator}"/>
  <property name="fromregexp"
  <property name="toregexp" value="\1${regexp.file.separator}\2"/>
  <move todir="a-project/translation">
   <fileset dir="a-project/translation">
    <include name="**/fr/*_fr.str"/>
   <mapper type="regexp" from="${fromregexp}" to="${toregexp}"/>

----- Original Message -----
From: "Joylene Nettleton" <>
To: <>
Sent: Tuesday, April 15, 2003 9:40 PM
Subject: Rename directory

> I have some files in a partially known directory path,
> c:\oaa-41\projects\a-project\translation\...\fr\*_fr.str.  I don't know
> path for "...", which could be more than one directory deep.  I want to
> those *_fr.str file to one level up,
> c:\oaa-41\projects\a-project\translation\...\*_fr.str.  Could anyone help?
> Thanks much.
> --Joylene

View raw message