ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Getting the filename from a property
Date Wed, 27 Feb 2002 23:57:09 GMT
--- Brian DeWeese <brd1_reuters@yahoo.com> wrote:
> What would be the best way to get just the filename from a property
> whose value is a fully qualified path?
> 
> Such as get "foo.txt" from "d:\dir1\dir2\foo.txt".

 <property name="foodir" location="d:/dir1/dir2"/>
 <target name="doFilename">
    <pathconvert pathsep="${file.separator}" property="filename">
      <path>
        <pathelement location="${foodir}/foo.txt"/>
      </path>
      <map from="${foodir}${file.separator}" to=""/>
    </pathconvert>
    <echo message="filename = ${filename}"/>
 </target>

Diane



=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

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


Mime
View raw message