ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy2008 <hoangt...@yahoo.com>
Subject Re: How to retrieve directory name
Date Fri, 25 Jun 2010 23:11:20 GMT

yeah, I tried it like below.  It gave me the directory name but only the
first directory.  The value does not change for all the subsequent
directories.  Do you have any ideas?

<sequential>
  <basename property="dirName" file="@{soa.project.dir}"/>
  <echo>@{soa.project.dir} : ${dirName}</echo>
</sequential>


David Weintraub wrote:
> 
> Have you tried the <basename> task?
> 
> On Fri, Jun 25, 2010 at 6:29 PM, Andy2008 <hoangtu69@yahoo.com> wrote:
>>
>> I'm looping thru a directory that contains a lot of sub directories.  I
>> want
>> to get the name of each sub directory.  Below is my code
>>
>> <for param="soa.project.dir">
>>   <path>
>>      <dirset dir="${svn.src.dir}">
>>        <present targetdir="${svn.src.dir}">
>>            <mapper type="glob" from="*" to="*/${bpel.composite}" />
>>             </present>
>>     </dirset>
>>   </path>
>> <sequential>
>>  <echo>@{soa.project.dir}</echo>
>> </sequential>
>> </for>
>>
>> Right now it outputs the whole path such as "c:\abc\def"  which is good
>> since I need the path but I also need the name of the subfolder too which
>> is
>> "def".  The path of the folder is not fixed as in my example.  It could
>> be a
>> long one too such as c:\aaa\bbb\ccc\ddd\eee\fff\def
>>
>> Do you have any ideas how to get the name?
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/How-to-retrieve-directory-name-tp28997168p28997168.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> 
> 
> -- 
> David Weintraub
> qazwart@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-retrieve-directory-name-tp28997168p28997375.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Mime
View raw message