source: release-kits/lirk3/bin/ant-installer/web/manual1.7.0/manual/CoreTasks/dirname.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 2.5 KB
Line 
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>
30Task to determine the directory path of a specified file.
31</p>
32<p>
33When this task executes, it will set the specified property to the
34value of the specified file (or directory) up to, but not including,
35the last path element. If the specified file is a path that ends in a
36filename, the filename will be dropped. If the specified file is just
37a 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". &lt;dirname&gt;
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> &lt;dirname property=&quot;antfile.dir&quot; file=&quot;${ant.file}&quot;/&gt;</pre>
65will set <code>antfile.dir</code> to the directory path for
66<code>${ant.file}</code>.
67<pre> &lt;dirname property=&quot;foo.dirname&quot; file=&quot;foo.txt&quot;/&gt;</pre>
68will set <code>foo.dirname</code> to the project's basedir.</p>
69
70
71
72</body>
73</html>
74
Note: See TracBrowser for help on using the repository browser.