Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get filename and extension from an absolute path

Tags:

ant

In an Ant buildfile I have a path stored in an Ant property: ${file}.

How can I get just the filename and extension without the full path?

like image 648
Stas Avatar asked Dec 28 '10 10:12

Stas


1 Answers

Use the Basename task

<basename property="filename" file="${file}"/>
like image 148
Axel Fontaine Avatar answered Oct 10 '22 17:10

Axel Fontaine