ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: how to find the drive name from a file fath ?
Date Tue, 01 Apr 2008 13:53:42 GMT

--- "Md. Jahidul Hasan" <jahidul.hasan@bjitgroup.com>
wrote:

> Is there any task to find the drive name from a
> given file/directory path
> ? "dirname"  task can't help in this regards as it
> takes the full path
> until that filename. I only need that drive name.

Ant 1.7.0, untested:

<property name="normalizedPath"
location="${givenPath}" />
<pathconvert>
  <first>
    <tokens>
      <string value="${normalizedPath}" />
      <stringtokenizer delims="${file.separator}" />
    </tokens>
  </first>
</pathconvert>

If by chance you want to work with svn trunk, it is
compatible with the experimental props antlib that
intends to provide this functionality inside a
property expression.

HTH,
Matt

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



      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No
Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

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


Mime
View raw message