You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dirname.html 2.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Dirname Task</title>
  20. </head>
  21. <body>
  22. <h2 id="echo">Dirname</h2>
  23. <h3>Description</h3>
  24. <p>Task to determine the directory path of a specified file.</p>
  25. <p>When this task executes, it will set the specified property to the value of the specified file
  26. (or directory) up to, but not including, the last path element. If the specified file is a path that
  27. ends in a filename, the filename will be dropped. If the specified file is just a filename, the
  28. directory will be the current directory.</p>
  29. <p><strong>Note</strong>: This is not the same as the UNIX <code>dirname</code> command, which is
  30. defined as "strip non-directory suffix from filename". <code>&lt;dirname&gt;</code> determines the
  31. full directory path of the specified file.</p>
  32. <h3>Parameters</h3>
  33. <table class="attr">
  34. <tr>
  35. <th scope="col">Attribute</th>
  36. <th scope="col">Description</th>
  37. <th scope="col">Required</th>
  38. </tr>
  39. <tr>
  40. <td>file</td>
  41. <td>The path to take the dirname of.</td>
  42. <td>Yes</td>
  43. </tr>
  44. <tr>
  45. <td>property</td>
  46. <td>The name of the property to set.</td>
  47. <td>Yes</td>
  48. </tr>
  49. </table>
  50. <h3>Examples</h3>
  51. <p>Set <code>antfile.dir</code> to the directory path for <samp>${ant.file}</samp>.</p>
  52. <pre>&lt;dirname property=&quot;antfile.dir&quot; file=&quot;${ant.file}&quot;/&gt;</pre>
  53. <p>Set <code>foo.dirname</code> to the project's <var>basedir</var>.</p>
  54. <pre>&lt;dirname property=&quot;foo.dirname&quot; file=&quot;foo.txt&quot;/&gt;</pre>
  55. </body>
  56. </html>