blob: 607123ad5cde72c50996f3e03a586e98786ff579 [file] [log] [blame]
<!DOCTYPE html>
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<html lang="en">
<title> Find Task</title>
<h2 id="find">Find</h2>
<p>Searches in a given path for a file and returns the absolute to it as property.
If delimiter is set this task returns all found locations.</p>
<table class="attr">
<th scope="col">Attribute</th>
<th scope="col">Description</th>
<th scope="col">Required</th>
<td>The name of the file to search.</td>
<td>The name of the property where to store the location</td>
<td>A delimiter to use when returning the list</td>
<td>only if the list is required</td>
<h3>Parameters specified as nested elements</h3>
<p>The path where to search the file.</p>
&lt;find file="ant.jar" location="loc">
&lt;fileset dir="${ant.home}"/>
Searches in Ant home directory for a file <samp>ant.jar</samp> and stores its location in
property <samp>loc</samp> (should be <samp>ANT_HOME/bin/ant.jar</samp>).
&lt;find file="ant.jar" location="loc" delimiter=";">
&lt;fileset dir="C:/"/>
&lt;echo>ant.jar found in: ${loc}&lt;/echo>
Searches in Windows <samp>C:</samp> drive for all <samp>ant.jar</samp> and stores their locations in
property <samp>loc</samp> delimited with <q>;</q>. (should need a long time :-)
After that it prints out the result (e.g. <samp>C:/ant-1.5.4/bin/ant.jar;C:/ant-1.6/bin/ant.jar</samp>).