ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Bukanov <i...@fastmail.fm>
Subject Search for file in parent directories
Date Tue, 08 Jul 2003 16:59:56 GMT
Hi!

I would like to search for the given file name in the given directory or 
one of its parents and set a property to found location. Something like 
ant -find <name> does. Are there any better way to do it then use when 
searching for a.txt:

<avaialble property="found-path"
  file="a.txt" value="a.txt"/>
<avaialble property="found-path"
  file="../a.txt" value="../a.txt"/>
<avaialble property="found-path"
  file="../../a.txt" value="../../a.txt"/>
<avaialble property="found-path"
  file="../../../a.txt" value="../../../a.txt"/>
etc.


Although it works if there is single a.txt in searched parent 
directories, but when there several a.txt, then trouble starts. First a 
warning will be produced about changing of property value, and second, 
it will set found-path to the outemost a.txt. I can fix the later by 
reversing <available> order, but then I would depend on deprecated 
bahaviour.

Any better ways to do it?

Regards, Igor



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


Mime
View raw message