ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: How to get the filename of a dirset - not the full path?
Date Mon, 10 Mar 2008 14:00:45 GMT
Use basename to get name of the dir.

Peter

On Mon, Mar 10, 2008 at 1:13 PM, Rob Wilson <netplay@gmail.com> wrote:
> Now that I have a list of directories, I would like to get the directory
>  NAME rather than the full path - I am trying to use the name to create
>  directories elsewhere and copy files from a few different places.
>
>  Basically I want something that returns me the name after the last slash -
>  but it looks like string manipulations might be trickier than first appears?
>
>  This is what I currently have...
>
>     <target name="create-branding">
>         <foreach param="directory" target="create-branding-dir">
>             <path>
>                 <dirset dir="../webcontent-branding">
>                     <depth max="0"/>
>                 </dirset>
>             </path>
>         </foreach>
>     </target>
>
>     <target name="create-branding-dir">
>         <echo message="creating-branding-dir called: ${directory}"/>
>         <mkdir dir="${distrib.dir}/${directory}" />
>     </target>
>
>
>  Cheers,
>  Rob.
>

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


Mime
View raw message