1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>Dirname Task</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="echo">Dirname</a></h2>
|
---|
28 | <h3>Description</h3>
|
---|
29 | <p>
|
---|
30 | Task to determine the directory path of a specified file.
|
---|
31 | </p>
|
---|
32 | <p>
|
---|
33 | When this task executes, it will set the specified property to the
|
---|
34 | value of the specified file (or directory) up to, but not including,
|
---|
35 | the last path element. If the specified file is a path that ends in a
|
---|
36 | filename, the filename will be dropped. If the specified file is just
|
---|
37 | a filename, the directory will be the current directory.
|
---|
38 | </p>
|
---|
39 | <p>
|
---|
40 | <em>Note:</em> This is not the same as the UNIX dirname command, which is
|
---|
41 | defined as "strip non-directory suffix from filename". <dirname>
|
---|
42 | determines the full directory path of the specified file.
|
---|
43 | </p>
|
---|
44 | <h3>Parameters</h3>
|
---|
45 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
46 | <tr>
|
---|
47 | <td valign="top"><b>Attribute</b></td>
|
---|
48 | <td valign="top"><b>Description</b></td>
|
---|
49 | <td align="center" valign="top"><b>Required</b></td>
|
---|
50 | </tr>
|
---|
51 | <tr>
|
---|
52 | <td valign="top">file</td>
|
---|
53 | <td valign="top">The path to take the dirname of.</td>
|
---|
54 | <td valign="top" align="center">Yes</td>
|
---|
55 | </tr>
|
---|
56 | <tr>
|
---|
57 | <td valign="top">property</td>
|
---|
58 | <td valign="top">The name of the property to set.</td>
|
---|
59 | <td valign="top" align="center">Yes</td>
|
---|
60 | </tr>
|
---|
61 | </table>
|
---|
62 |
|
---|
63 | <h3>Examples</h3>
|
---|
64 | <pre> <dirname property="antfile.dir" file="${ant.file}"/></pre>
|
---|
65 | will set <code>antfile.dir</code> to the directory path for
|
---|
66 | <code>${ant.file}</code>.
|
---|
67 | <pre> <dirname property="foo.dirname" file="foo.txt"/></pre>
|
---|
68 | will set <code>foo.dirname</code> to the project's basedir.</p>
|
---|
69 |
|
---|
70 |
|
---|
71 |
|
---|
72 | </body>
|
---|
73 | </html>
|
---|
74 |
|
---|