Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Rename directories in Ant

Rename directories in Ant

2007-06-13       - By Cesar Martinez Izquierdo
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Hi, I'm trying to rename every "search" directory in a tree to
"search_", but I'm not able to find the right way to do it.

For example, if I have the files:


I want to rename them to:


I've read the docs and searched in Google, but I didn't find the solution.

I have tried the following:
<antcall target="renameFiles">
 <param name="targetDir" value="/tmp/myDir" />
 <param name="oldValue" value="/search"/>
 <param name="newValue" value="/search_" />
<target name="renameDirs"
   description="Rename directories frin ${oldValue} to ${newValue}">
 <move todir="${targetDir}" verbose="yes">
   <regexpmapper from="(.*)(${oldValue})(.*)" to="\1${newValue}\3"

But I get the results:
/tmp/myDir/test/hello/search_/nice/lists [empty dir]

which is not the result I expected.
Is there a way to perform this task? If it's possible, it would be very
useful to include it in the documentation, as I've found in Google
several people trying to do it, but none of them found the solution.


C?sar Mart?nez Izquierdo
Equipo de desarrollo gvSIG

C/ Salamanca 50
46005 Valencia - Spain

To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.