1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>Dirname Task</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="echo">Dirname</a></h2>
|
---|
12 | <h3>Description</h3>
|
---|
13 | <p>
|
---|
14 | Task to determine the directory path of a specified file.
|
---|
15 | </p>
|
---|
16 | <p>
|
---|
17 | When this task executes, it will set the specified property to the
|
---|
18 | value of the specified file (or directory) up to, but not including,
|
---|
19 | the last path element. If the specified file is a path that ends in a
|
---|
20 | filename, the filename will be dropped. If the specified file is just
|
---|
21 | a filename, the directory will be the current directory.
|
---|
22 | </p>
|
---|
23 | <h3>Parameters</h3>
|
---|
24 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
25 | <tr>
|
---|
26 | <td valign="top"><b>Attribute</b></td>
|
---|
27 | <td valign="top"><b>Description</b></td>
|
---|
28 | <td align="center" valign="top"><b>Required</b></td>
|
---|
29 | </tr>
|
---|
30 | <tr>
|
---|
31 | <td valign="top">file</td>
|
---|
32 | <td valign="top">The path to take the dirname of.</td>
|
---|
33 | <td valign="top" align="center">Yes</td>
|
---|
34 | </tr>
|
---|
35 | <tr>
|
---|
36 | <td valign="top">property</td>
|
---|
37 | <td valign="top">The name of the property to set.</td>
|
---|
38 | <td valign="top" align="center">Yes</td>
|
---|
39 | </tr>
|
---|
40 | </table>
|
---|
41 |
|
---|
42 | <h3>Examples</h3>
|
---|
43 | <pre> <dirname property="antfile.dir" file="${ant.file}"/></pre>
|
---|
44 | will set <code>antfile.dir</code> to the directory path for
|
---|
45 | <code>${ant.file}</code>.
|
---|
46 | <pre> <dirname property="foo.dirname" file="foo.txt"/></pre>
|
---|
47 | will set <code>foo.dirname</code> to the project's basedir.</p>
|
---|
48 |
|
---|
49 | <hr>
|
---|
50 | <p align="center">Copyright © 2002,2004 The Apache Software Foundation.
|
---|
51 | All rights Reserved.</p>
|
---|
52 |
|
---|
53 | </body>
|
---|
54 | </html>
|
---|
55 |
|
---|