ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "david" <da...@davidwbrown.name>
Subject Re: how can I copy a directory of files to lower case equivalents?
Date Tue, 02 Oct 2007 12:14:37 GMT
Hello Alx, assuming you are on some type of NIX system (Windows doesn't car about case) the
following is untested but you might want to twiddle around with it or this may get you a starting
point in another direction:

<exec executable="/bin/mv">
    <arg value="${file}"/>
    <arg value="`echo ${file}|perl -ne 'chomp;print "$_" if (tr/A-Z/a-z/);'`"/>
</exec>

Alx G wrote ..
> 
> Hi,
> 
> Does anyone know if there's anything in Ant that can copy files from a
> directory to another directory but change all the file names to lower case?
> 
> e.g.
> 
> working/some_folder/etc/Blah.jpg => dist/some_folder/etc/blah.jpg
> ...
> etc. for a whole load of files in various directories.
> 
> Perhaps there's something I can add to this?
> 
> <copy todir="${dist.dir}/images">
>     <fileset dir="images"/>
> </copy>
> 
> If there's nothing in Ant directly, I'm going to have to write a PHP script
> that does the renaming but I'd prefer not to create more scripts.
> 
> Any help would be much appreciated.
> 
> Many Thanks!
> 
> -- 
> View this message in context: http://www.nabble.com/how-can-I-copy-a-directory-of-files-to-lower-case-equivalents--tf4554266.html#a12996743
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message