This requires that I separate the property in 2 parts, the path and
the filename, so then since I already have the filename by itself
there's no need to parse it.
I need this for a <ant> call so I think the best solution is to
separate the property out as you suggestion and pass both parts into
the ant call. The fully qualified name is needed for a <copy> task
where the lonesome filename is needed for the Netscape signing tool.
This will solve my problem in the short run, but I still think it
would be nice to have a special property syntax to extract the parts.
Erik's suggestions are probably better than mine, but FWIW I was
thinking about something like $f{property} where each letter between
the $ and { stood for a part; f=filename, e=extension, p=path, and so
on. But that's not very readable.
Brian
--- Diane Holt <[EMAIL PROTECTED]> wrote:
> --- Brian DeWeese <[EMAIL PROTECTED]> 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
>
>
>
> =====
> ([EMAIL PROTECTED])
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion!
> http://greetings.yahoo.com
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>